need help on this toggle for little change

capsmasty

New Member
in this code below i simply want when i click on any content inside panel (content contained in p tags within panel), should not slidup the panel, till the click on panel or elsewhere is used but not child elements p inside panels, see html in fiddle for help and click try should not close the panel if the click event on other than it is used. this script was helped me with mr praveen earlier.the code is\[code\]$(document).ready(function () { $("#toggle li > .panel").hide(); $('.plusminus').html('+'); $('#toggle li').click(function () { if( !$(this).children('.panel').is(":visible") ) { $("#toggle li > .panel").slideUp(); $('.plusminus').html('+'); } a = $(this).children(".plusminus"); $(this).children(".panel").slideToggle('fast', function(){ a.html($(this).is(":visible") ? '--' : '+'); }); }); $("body").click(function(event){ if ($(event.target).closest("ul").attr('id') != "toggle") { $("#toggle li > .panel").slideUp(); $('.plusminus').html('+'); } });});\[/code\]fiddle to play with ishttp://jsfiddle.net/praveenscience/Ss3xU/26/
 
Back
Top