jquery - Image slider inside (ajax) .load breaks -
this first question on forum , relates .load element in ajax. have unordered list in list items clickable links:
<ul id="menubutton"> <a href="index.html" rel="address:/home" id='home'><li id="html/home.html" class="current"><p>home</p></li></a> <a class="clickable" href="html/projects.html" rel="address:/projects" id='projects'><li id="html/projects.html" class=""><p>projects</p></li></a> <a class="clickable" href="html/designers.html" rel="address:/designers" id='designers'><li id="html/designers.html" class=""><p>designers</p></li></a> <a class="clickable" href="html/contact.html" rel="address:/contact" id='contact'><li id="html/contact.html" class=""><p>contact</p></li></a> </ul>
when clicked these links load different html snippets, of contain image sliders (the home , projects links). these load fine on first time content requested, if navigate tab , sliders not function anymore. code employing ajax method in $.(document).ready function , looks follows.
$('a.clickable').click(function(){ var toload = $(this).attr('href') + '#main'; $('#content').slideup('slow', loadcontent); window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5); function loadcontent(){ $('#content').load(toload, '' , shownewcontent()) } function shownewcontent(){ $.getscript("projectviewer.js",function(){alert('projectview ok')}); $.getscript("jquery.slicebox.js"); $('#content').slidedown('slow') } return false; });
i stumped on how fix this, having tried different methods. know scripts load because projectview ok alert, somehow navigation breaks on image sliders.
is there has seen error before , can help?
on side note: if knows how backbutton functionality .load ajax method appreciated well.
Comments
Post a Comment