Hi,
I have a question regarding Jquery :). I'm just a beginner and I don't know much that's why I need your help.
I have a main menu that is drop down menu with images. But that other list must be separated. Why? Cause I'm working with Kentico CMS (ASP.NET) and I have to change control if I want to display my MM this way. This is easier :).
So... put now CMS aside and let do this in plain HTML.
Code that I have is :
<body>
<ul id="MM">
<li><a href="#" id="mm1" class="mm">First link</a></li>
<li><a href="#" id="mm2" class="mm">Second link</a></li>
<li><a href="#" id="mm3" class="mm">Third link</a></li>
<li><a href="#" id="mm4" class="mm">Fourth link</a></li>
<li><a href="#" id="mm5" class="mm">Fifth link</a></li>
</ul>
<div>
<ul id="images">
<li class="hidden" id="mm1Show"><img src="http://www.wallpaperscollection.net/d/24895-2/free-wallpapers-nature-887.jpg" alt="" /></li>
<li class="hidden" id="mm2Show"><img src="http://www.punemobile.com/wallpapers/d/735-4/You+are+viewing+the+Nature+wallpaper" alt="" /></li>
<li class="hidden" id="mm3Show"><img src="http://www.punemobile.com/wallpapers/d/563-4/Forces+of+Nature+Wallpaper" alt="" /></li>
<li class="hidden" id="mm4Show"><img src="http://www.wallpaperscollection.net/d/24895-2/free-wallpapers-nature-887.jpg" alt="" /></li>
<li class="hidden" id="mm5Show"><img src="http://www.punemobile.com/wallpapers/d/735-4/You+are+viewing+the+Nature+wallpaper" alt="" /></li>
</ul>
</div>
</body>
Now... on mouse over the first link the first image should be displayed. And so on.
The best I can do with Jquery is:
<script type="text/javascript">
$(document).ready(function(){
$('.hidden').hide();
$('#mm1').mouseover(function() {
$('#mm1Show').toggle("slow");
return false;
});
$('#mm1').mouseout(function() {
$('#mm1Show').toggle("slow");
return false;
});
$('#mm2').mouseover(function() {
$('#mm2Show').slideDown();
return false;
});
$('#mm2').mouseout(function() {
$('#mm2Show').slideUp();
return false;
});
});
</script>
One is with toggle and one is with slideDown/slideUp.
Is there any way I can do this (with Jquery) to avoid all this Jquery code? Cause now.. the images are humping 2 times when opening and closing the images.
Pleaaase help.
Thank you very much.
Yours TG ;)