javascript - Have only 1 div toggle instead of all -
running issues of trying have 1 div toggle instead of them toggle. i've tried using next()
, setting selector children
opposed parent element, won't toggle open @ all.
fiddle: http://jsfiddle.net/l415g07n/2/
what trying accomplish? have selected div toggle when .toggle
clicked instead of of them being toggled @ once.
var c1 = $("#o"); var c2 = $("#t"); var c3 = $("#th"); $(document).ready(function () { $(c1).hide(0).delay(500).fadein(1500); $(c2).hide(0).delay(1500).fadein(1500); $(c3).hide(0).delay(2500).fadein(1500); }); var content = $("#main .column .body"); $(content).hide(); var t1 = $(".toggle"); $(t1).click(function () { $(content).slidetoggle('slow'); $(t1).toggleclass("toggle"); $(t1).toggleclass("toggle-d"); });
try use this
object , traverse required nodes,
$(t1).click(function () { $(this).toggleclass("toggle") .toggleclass("toggle-d") .parent().next('.body').slidetoggle('slow'); });
Comments
Post a Comment