0
我需要设计菜单,以这样的方式,这样子菜单下面旁边的下拉菜单的li元素显示格
图像显示为节目让我们说,菜单1,2,3应该表现出相应的右边的div和菜单4,5应该在菜单左边显示div容器,如下图所示。
到目前为止,我已经能够设法使其工作到一定程度,但它并不完美。
这个问题,我能够显示对应的下一个子菜单X格但它旁边的子菜单中显示它,而我希望它显示在菜单的子菜单contianer的状元秀了。
我希望它将第一个子菜单显示为默认选择,当鼠标悬停在父菜单上时,目前它不会显示与子菜单相关的文本和图像,除非我将鼠标悬停在子菜单上。
下面是代码。
<nav>
<ul>
<li><a href="#">Menu1</a></li>
<li><a href="#">Menu2</a>
<ul>
<li><a href="#">Menu 1</a>
<ul class="block">
<li><div class="div">This block show some text and an image on the right side of the text </div></li>
</ul>
</li>
<li><a href="#">Menu 2</a>
<ul class="block">
<li><div class="div">This block show some text and an image on the right side of the text </div></li>
</ul>
</li>
<li><a href="#">Menu 3</a>
<ul class="block-right">
<li><div class="div-right">This block show some text and an image on the right side of the text </div></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Menu3</a>
<ul>
<li><a href="#">Menu 2</a></li>
<li><a href="#">Menu 2</a></li>
</ul>
</li>
<li><a href="#">Menu4</a></li>
<li><a href="#">Menu 5</a>
<ul>
<li><a href="#">Menu 1</a>
<ul class="block">
<li><div class="div">This block show some text and an image on the right side of the text </div></li>
</ul>
</li>
<li><a href="#">Menu 2</a>
<ul class="block">
<li><div class="div">This block show some text and an image on the right side of the text </div></li>
</ul>
</li>
<li><a href="#">Menu 3</a>
<ul class="block">
<li><div class="div">This block show some text and an image on the right side of the text </div></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
我希望关于我使用jquery用这么使其正常显示和工作不介意在这个帮助。
我希望它是那么容易。我想功能接近我已经解释过。你已经显示的例子是干净的,有点容易。对我来说很困难的是,它应该显示宽度为500px的父菜单下的contianer div,并且当鼠标悬停在子菜单上时,文本应该会更改。我喜欢你子菜单设计它很干净... – Learning
+1为干净的例子... – Learning
@KnowledgeSeeker谢谢。 – falguni