Jump to content

Jquery Show/hide Problem


severndigital

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.