animation - Jquery .show not animating properly and not grabbing all links in target -
animation - Jquery .show not animating properly and not grabbing all links in target -
essentially i'm trying load content div, link within div. works degree. code far grabs links target div , on click animates 'content' div out , replaces 'content' div @ target link.
//target links , phone call on click $('#scrollbox li a').click(function(){ //define load paramaters var toload = $(this).attr('href')+' #content'; //hide content $('#content').hide('fast',loadcontent); //remove load bar $('#load').remove(); //show load bar $('#wrapper').append('<span id="load">loading...</span>'); $('#load').fadein('normal'); function loadcontent() { $('#content').empty().load(toload,'',shownewcontent()) } function shownewcontent() { $('#content').show('slow',hideloader()); } function hideloader() { $('#load').fadeout('normal'); } homecoming false; }); first issue after hiding old content, on showing of new content , animation choppy, , old content still visible , animates in until @ lastly milisecond new content "flashes" in. shouldn't old content hide , new content show? tried prepare .empty flicks in though there no .show animation @ all.
second issue links of code seem have effect on header links in target div, links within 'content' div (inside target div) unaffected , reload whole page. need target div's within div's? not targeting links within div in code?
if need farther clarification on please allow me know.
cheers , help.
fixed. set animations 0 there none @ all. (so sort of inexpensive fix)
used .live() command bind command subsequent links on reload.
$(document).ready(function(){ $('.scroll-pane').jscrollpane({showarrows: true}); $('#scrollbox a').live('click', function() { //all elements exist , elements added later //with class have click event attached //define load paramaters var toload = $(this).attr('href')+' #content'; //hide content $('#content').hide(0,loadcontent); function loadcontent() { $('#content').load(toload,'',shownewcontent()) } function shownewcontent() { $('#content').fadein(0); } homecoming false; }); }); jquery animation hide show target
Comments
Post a Comment