Wednesday, 15 August 2012

jquery - on click toggle - other class width need to toggle -



jquery - on click toggle - other class width need to toggle -

on click on toggle id or class - how toggle width of other class.

$(document).ready(function() { $('.toggle-icon').click(function(){ $('.navtext,.prom_arrow').toggle( function() { $('.iconwrap').addclass('iconwrap1'); }, function(){ $('.iconwrap').removeclass('iconwrap1'); } ); $("span",this).toggleclass("sprite-collapse sprite-expand"); }); });

in above code: want alter width 'iconwrap'class on toggle time.

you can utilize

$(document).ready( function(){ $('#toggle-icon').click( function() { var togglewidth = $("#iconwrap").width() == 300 ? "200px" : "300px"; $('#iconwrap').animate({ width: togglewidth }); }); });

jquery

No comments:

Post a Comment