severndigital Posted November 10, 2012 Share Posted November 10, 2012 I am trying to show / hide some divs inside another div, I am running into a problem. here is my code <script> function showTools() { $('#toggle').show('blind'); } function hideTools() { $('#toggle').hide('blind'); } </script> <h1>Test Area</h1> <div id="wrapper" style="height:150px; width:125px; border:1px solid black;" onmouseover="showTools();" onmouseout="hideTools();"> <div id="toggle" class="span-3 last hideMe"> <div id="tool1" class="span-1"> Tool </div> <div id="tool2" class="span-1"> Tool </div> <div id="tool3" class="span-1 last"> Tool </div> </div> </div> <script> $(function(){$('.hideMe').hide();}); </script> the problem is when I enter the "revealed" div, it counts as a "onmouseout" command on the wrapper div and hides the toggle div. once the div is gone it counts as a "onmouseover" on the wrapper div and the toggle div appear again. This loops over and over until you move off the wrapper div. I know why it's happenen, but I have no idea how to fix it. Any help would be great. thanks, Link to comment https://forums.phpfreaks.com/topic/270552-jquery-showhide-problem/ Share on other sites More sharing options...
haku Posted November 11, 2012 Share Posted November 11, 2012 Which one is the 'revealed' div? Not seeing that. Link to comment https://forums.phpfreaks.com/topic/270552-jquery-showhide-problem/#findComment-1391643 Share on other sites More sharing options...
codefossa Posted November 11, 2012 Share Posted November 11, 2012 You're using jQuery, so why not use the $.hover() function? That lets you do hover/unhover without all the extra attributes and functions. Link to comment https://forums.phpfreaks.com/topic/270552-jquery-showhide-problem/#findComment-1391652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.