Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:12:10+00:00 2026-06-11T17:12:10+00:00

I know very little about javascript so I’m not exactly sure what I’m doing.

  • 0

I know very little about javascript so I’m not exactly sure what I’m doing. Basically, our team is working on a project that uses the jQuery weekcalendar javascript. By default the calendar will display an entire week.

My problem is this: I have multiple css files that fit different screens which I call using another javascript. For the smallest screen resolution, the one I call for mobiles and the entire calendar wouldn’t fit the set width for this resolution so I need to display just the current day. I’ve found on websites that I need to use $('#calendar').weekCalendar("today") but I can’t figure out how to implement it and what I should put on the if statement.

Here’s what the code I tried looks like,

<script type="text/javascript">
$(document).ready(function () {
    if (document.styleSheets('mobile.min.css')) {
        $('#calendar').weekCalendar('today');
    }
})

Obviously, that doesn’t work and I believe its wrong. Can somebody please help me? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:12:11+00:00Added an answer on June 11, 2026 at 5:12 pm

    I haven’t used the Adapt js library but looking at it you can implement a callback function. That means when the page is resized, it will call your function.

    so make sure that in your declaration of the ADAPT CONFIG the call back is set. In this case


    callback: ChangeCalendar

    Then on your page in the script tags, or in the js file you need a callback function to handle the callback. it will pass an index corresponding to the size that applies. I recommend using a switch statement in the callback function to handle the size change.


    ChangeCalendar(index, width)
    {
        switch (index) {
           // handles the first item in the range (0 to 760px)
         case 0: $('#calendar').weekCalendar('today');
         break;
          // handles the second item in the range (760 to 980px)
        case 1: //something else
          break;
        // handles everything we missed
        default:
        break;
       }
    }

    Of course you could vary this to use the width parameter, and then use if statements to handle a set of ranges, such as if (width > 950) { etc }

    I hope this solves your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know very little about Flash, and so is not programming in it. I
First, please be gentle, I know very little about DB design. I am working
I code in python and know very little about html, mysql, javascript or other
I'm working with an iPhone developer on an application. I know very little about
I have basically no knowledge of sbt and know very little about maven or
As I know very little about Javascript and Jquery I am hoping to be
I know very little about JavaScript but despite this I'm trying to cobble something
I was recently given a project to modify and I know very little about
I know very little about Javascript and jQuery, and I'm attempting to use jQuery
I know very little about Magento and did not build the site in question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.