0

I meet a problem when doing the YAHOO.widget.CalendarGroup.
I want to do it like this, if the page widtha is less than 720px, the CalendarGroup PAGES property is 1
enter image description here,
if more than 720px, the CalendarGroup use the default PAGES property is 2enter image description here.
I use

myCalendar.cfg.setProperty("PAGES",1);

but it doesn't work, I found in the document here: http://developer.yahoo.com/yui/docs/YAHOO.widget.CalendarGroup.html#config_pages

pages - Number The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments. Default Value: 2

Seems we can't change the pages property after the initicalization. How could I change the pages based on the change of my browser width? THANKS.

1 Answer 1

0

As it says: "This value can only be set once, in the CalendarGroup's constructor arguments". Use the constructor, like this:

var myCalObject = new YAHOO.widget.CalendarGroup(
    calObject, 
    calObject + "Container", 
    { pages: 2, close: true, iframe: false }
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.