gkdm
gkdm

Reputation: 2375

Problem loading dynamic content of html + js via ajax

I'm using the jQuery UI Tabs plug-in to load html pages via ajax, so I have the following html:

<div id="tabs">
   <ul>
      <li><a href="pageWithGallery.html" title="pageWithGallery">Gallery</a></li>
   </ul> 
</div>

The loaded page pageWithGallery.html contains a jQuery gallery which plays on $(document).ready. this however doesn't work when the ui-tabs plug-in loads the page via ajax . How then should I do this? Thanks!

Upvotes: 0

Views: 332

Answers (1)

Christoffer
Christoffer

Reputation: 26785

You can initialize the jQuery gallery on tab load.

$('#tabs').tabs({
   load: function(event, ui) {
      // load gallery ...
   }
});

Upvotes: 1

Related Questions