views:

67

answers:

0

I'm implementing a page jquery tab toggle that loads content from hidden divs on the page. on one of the hidden pages i have a calendar popup (part of the jQuery.UI api. this works find on it's own page but when i add it to a hidden block and then load that block into the visible window i loose the ability for the calendar to pop up correctly. i've attempted using live without luck - it's worked for other event bound elements on these hidden div pages.

here is a sample of what im doing:

$(".tab-toggle").live("click",function() {
  alert("test");
  $(".calendar-class").datepicker({showOn: 'both', buttonImage: 'images/icon-calendar2.gif', buttonImageOnly: false, changeMonth: true, changeYear: true, yearRange: '2009:2015'});
});

the alert fires on each pageload but the calendar isn't being rebound to an event.

$(".calendar-class").datepicker({showOn: 'both', buttonImage: 'images/icon-calendar2.gif', buttonImageOnly: false, changeMonth: true, changeYear: true, yearRange: '2009:2015'});

works fine in pages where it immediately loads into the viewable window but stops working when i tab over to another page and then tab back...