Thursday, 15 March 2012

javascript - Fade Toggle not working -



javascript - Fade Toggle not working -

question: why fade in/fade out not fire/work? how best resolve?

backstory: clicking link trigger javascript/jquery event display or hid series of li's. i've been able create link when clicked 'pop' bunch of links (reveal) or hide them, feels kind of abrupt me , i'm trying create them cascade/fade in , cascade out/fade out, script not working seems. have tried googling , looking @ jskit , jquery websites not found can understand plenty impliment.

access example: click on white arrow icon in little gray box in upper right corner of browser reveal/open navigation draw. scroll downwards magenta colored link reads 'display/hide on click'. clicking magenta link ought reveal 3 lis (a), (b), , (c). clicking magenta link ought hide them. however, when click magenta test link, nil happens, li's remain 'hidden'. 1 first attempts javascript/jquery , i'm dreadfully confused , hoping find guidance on how solve issue. @ best hobbist when comes things this, consider myself more of persistent newbie.

url: enter link description here

<!-- jquery fadetoggle --> <!-- css straight embedded testing -> add together tweak.css when done <style media="screen" type="text/css"> #divb { display:none; } </style> <a href="#" onclick="fadetoggle()" id="diva">display/hide on click</a> <div id="divb"> <ul> <li>a</li> <li>b</li> <li>c</li> </ul> </div> <!-- function located in scripts/jsfunctions.js --> var fadetoggle = (function() { $(document).on("click",function (e) { if (e.target.id=="diva") { $("#divb").fadetoggle(200); e.stoppropagation(); homecoming false; } else if ($("#divb").is(":visible")) { $("#divb").fadeout(200); } }); });

after script phone call function fadetoggle() jsfiddle

javascript jquery html5 toggle fade

No comments:

Post a Comment