Source: http://www.designchemical.com/blog/...adding-vertical-animation-jquery-slider-menu/
what i want to do is make a drop down menu exactly like how they have their word press plugins drop down. Im having trouble figuring it out. This is my code. I have done all logical things. this is how far i am
as you can see i put the object within the first item drop down menu. The problem is that the drop down item only displays the objects drop down list and not the corresponding box with the images. I have tried re-sizing it but it only re-sizes the list item container and still doesn't display the corresponding images. Here is the CSS for the drop down menu bar
what i want to do is make a drop down menu exactly like how they have their word press plugins drop down. Im having trouble figuring it out. This is my code. I have done all logical things. this is how far i am
HTML:
<script type="text/JavaScript">
$(document).ready(function() {
// Declare variables
var width = 400;
var slides = $('#list-images li');
var numSlides = slides.length;
// Wrap the slides & set the wrap width - this will be used to animate the slider left/right
slides.wrapAll('<div id="slide-wrap"></div>').css({'float' : 'left','width' : width});
$('#slide-wrap').css({width: width * numSlides});
// Hover function - animate the slides based on index of links
$('#list-links li a').hover(function(){
$('#list-links li').removeClass('hover');
var i = $(this).index('#list-links li a');
$(this).parent().addClass('hover');
$('#slide-wrap').stop().animate({'marginLeft' : width*(-i)});
});
});
</script>
<style type="text/css">
body,html,div,blockquote,img,label,p,h1,h2,h3,h4,h5,h6,pre,ul,ol,li,dl,dt,dd,form,a,fieldset,input,th,td{border:0;outline:none;margin:0;padding:0;}
body{height:100%;background:#fff;color:#1f1f1f;font-family:Arial,Verdana,sans-serif;font-size:13px;padding:7px 0;}
ul, ol{list-style:none;}
a {text-decoration: none;}
.text-center {text-align: center; padding: 10px 0;}
h2 {margin-bottom: 30px;}
.wrap {width: 653px; margin: 0 auto;}
.clear {clear: both;}
/* Tutorial CSS */
#menu-slider {
background: url(images/bg_menu_slider.png) no-repeat 0 0;
padding: 15px;
margin-bottom: 20px;
}
/* Required */
#list-images, #list-images li {
height: 292px;
width: 400px;
display: block;
}
#list-images {
float: right;
overflow: hidden; /* Required to hide the inactive slides */
border: 1px solid #ccc;
}
#list-images li {
position: relative;
}
#list-images li img {
background: #fff;
position: absolute;
top: 0;
left: 0;
}
/* Image captions */
#list-images li span {
background: url(images/grid1.png) repeat 0 0;
position: absolute;
bottom: 0;
left: 0;
width: 362px;
display: block;
padding: 14px 20px;
font: bold 20px Arial, sans-serif;
color: #fff;
height: 20px;
line-height: 20px;
}
/* Menu text links */
#list-links {
width: 220px;
float: left;
}
#list-links li {
padding: 0 15px 0 0;
}
#list-links li a {
font: normal 12px Arial, sans-serif;
color: #222;
padding: 8px 5px 8px 8px;
border-bottom: 1px solid #ccc;
font-weight: bold;
font-size: 13px;
display: block;
}
#list-links li.hover {
background: url(images/tab_current.png) no-repeat 100% center;
}
#list-links li.hover a, #list-links li.hover a:hover {
color: #fff;
background: none;
border-bottom: none;
padding-bottom: 9px;
}
#list-links li.last a {
border-bottom: none;
}
</style>
<link href="../../../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
<div class="wrap">
<ul id="list-links">
<li class="hover"><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-drop-down-mega-menu-widget/">Mega Menu</a></li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-mega-menu-widget/">Vertical Mega Menu</a></li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/">Vertical Accordion Menu</a></li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-drill-down-ipod-menu-widget/">jQuery Drill Down iPod Menu</a></li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-slick-menu-widget/">jQuery Slick Menu</a></li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-floating-menu/">Floating Menu</a></li>
<li class="last"><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-slick-social-share-buttons/">Slick Social Share Buttons</a></li>
</ul>
<ul id="list-images">
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-drop-down-mega-menu-widget/">
<img src="http://www.designchemical.com/media/images/mega_1a.jpg" alt="" />
<span>jQuery Horizontal Mega Menu</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-mega-menu-widget/">
<img src="http://www.designchemical.com/media/images/mega_2a.jpg" alt="" />
<span>jQuery Vertical Mega Menu</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/">
<img src="http://www.designchemical.com/media/images/mega_3a.jpg" alt="" />
<span>jQuery Vertical Accordion Menu</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-drill-down-ipod-menu-widget/">
<img src="http://www.designchemical.com/media/images/mega_4a.jpg" alt="" />
<span>jQuery Drill Down iPod Menu</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-slick-menu-widget/">
<img src="http://www.designchemical.com/media/images/mega_5a.jpg" alt="" />
<span>jQuery Slick Menu</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-floating-menu/">
<img src="http://www.designchemical.com/media/images/mega_6a.png" alt="" />
<span>Floating Menu Widget</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-floating-tweets/">
<img src="http://www.designchemical.com/media/images/mega_7a.png" alt="" />
<span>Floating Tweets Widget</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugin-slick-contact-forms/">
<img src="http://www.designchemical.com/media/images/mega_8a.jpg" alt="" />
<span>Slick Contact Forms</span></a>
</li>
<li><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-slick-social-share-buttons/">
<img src="http://www.designchemical.com/media/images/mega_9a.jpg" alt="" />
<span>Slick Social Share Buttons</span></a>
</li>
</ul>
</div> </li>
<li><a href="#">Item 2</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
<ul>
<li><a href="#">Item 3.1.1</a></li>
<li><a href="#">Item 3.1.2</a></li>
</ul>
</li>
<li><a href="#">Item 3.2</a></li>
<li><a href="#">Item 3.3</a></li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
</ul>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../../../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../../../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
as you can see i put the object within the first item drop down menu. The problem is that the drop down item only displays the objects drop down list and not the corresponding box with the images. I have tried re-sizing it but it only re-sizes the list item container and still doesn't display the corresponding images. Here is the CSS for the drop down menu bar
Last edited by a moderator: