jquery - Images slider does not work in ajax loaded content -


jquery(document).ready(function($) { var $maincontent = $("#main_class"),     siteurl = "http://" + top.location.host.tostring(),     url = '';  $(document).delegate("a[href*='/classes/']:not([href*=/wp-admin/]):not([href*=/wp-login.php]):not([href$=/feed/]):not([href$=/event-registration/])", "click", function() {     location.hash = this.pathname;     return false; });   $(window).bind('hashchange', function(){     url = window.location.hash.substring(1);      if (!url) {         return;     }      url = url + " #main";      $maincontent.animate({opacity: "0.1"}).html('please wait...').load(url, function() {         $maincontent.animate({opacity: "1"});     }); }); $(window).trigger('hashchange'); $('#slider').royalslider({                        imagealigncenter:true,            imagescalemode: "fill", }); 

});

the ajax content working prefect when load content in ajax div slider ( royal slider ) doesn't work . how can modify code achieve royal slider . im using wordpress , custom designed theme .

i cant tell sure without context , maybe html code, think need call $('#slider').royalslider(...); again after load new content.

when call function first time, targeting #slider in dom. when load new content ajax call, removed element , replace new one. believe need initialize slider again.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -