I know very little about javascript, so I'm not quite sure what I am doing. Our team is mainly working on a project that uses jQuery weekcalendar javascript. By default, the calendar will be displayed for a whole week.
My problem is this: I have several css files that are suitable for different screens, which I call using another javascript. For the smallest screen resolution, the one I call for mobile phones and the entire calendar will not correspond to the specified width for this resolution, so I only need to display the current day. I found on sites that I need to use $('#calendar').weekCalendar("today"), but I can’t figure out how to implement it and what I should use for the if statement.
This is what the code I tried looks like,
<script type="text/javascript">
$(document).ready(function () {
if (document.styleSheets('mobile.min.css')) {
$('#calendar').weekCalendar('today');
}
})
Obviously, this does not work, and I believe that it is wrong. Can someone please help me? Thank.
source
share