Just copy and paste this code in a notepad and run it in a browser you will know . <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("#flip").click(function(){ $("#panel").slideToggle("slow"); }); }); </script> <style type="text/css"> #panel,#flip { padding:5px; text-align:center; background-color:#e5eecc; border:solid 1px #c3c3c3; } #panel { padding:50px; display:none; } </style> </head> <body> <div id="flip">Click to slide the panel down or up</div> <div id="panel">Hello world!</div> </body> </html>
not quite sure what you are trying to achieve, but if it's okay for you to use CSS3 you might wanna try ":nothover)" to target sibling elements. <div id="widget-a" class="widget"> ... </div> <div id="widget-b" class="widget"> ... </div> <div id="widget-c" class="widget"> ... </div> Code (markup): .widget:not(:hover) { display: none; /* or other effect */ } Code (markup): so when you hover on widget a, widget b and c will be hidden