[jQuery] Starting with jQuery HELP
Hi I am trying to make a simple rollover system where the user rolls
over an image and a corrosponding div shows after the exsiting div
disappears in a container div.
Basically the problem is I cannot seem to find code how this can be
done. I can show the required div but it keeps sliding down when I
hover. How can I check if the required div is already show and by
doing so not procede with the slide down
Please see code below
<script type="text/javascript">
$(document).ready(function() {
$('div.information > div').hide();
$('img.thumb').hover(function(){
id = ($(this).attr("required"));
$('div.information > div#' + id).slideDown();
});
});
</script>
<title></title>
</head>
<body>
<img src="images/grey-box.gif" required="1" class="thumb"
height="87" width="96">
<div class="information">
<div id="1">This is some information with the ID of 1</div>
<div id="2">This is some information with the ID of 2</div>
</div>
<img src="images/grey-box.gif" required="2" class="thumb"
height="87" width="96">