【发布时间】:2011-06-09 14:25:00
【问题描述】:
我需要该网站导航菜单http://recruitmentmalta.com/ptowers/ 的确切效果,但代码更简洁。这段代码是使用从 PSD 转换为 HTML/CSS 的工具生成的,基本上创建了一堆无用的代码。我知道如何制作该菜单,除了只有在联系人悬停时才会关闭“立即购买”效果的部分。
当我将鼠标悬停在联系按钮上时(当 Shop Now 被关闭时),我有什么想法可以重新创建悬停效果吗?
这是我到目前为止所做的,目的是为您提供一个想法
<ul>
<li id="homeButton"> <img src="images/home.png" onmouseout="this.src='images/home.png'" onmouseover="this.src='images/homeHover.png'" width="115" height="55" alt="home" /></li>
<li id="aboutButton"> <img src="images/about.png" onmouseout="this.src='images/about.png'" onmouseover="this.src='images/aboutHover.png'" width="115" height="55" alt="about" /></li>
<li id="newsButton"> <img src="images/news.png" onmouseout="this.src='images/news.png'" onmouseover="this.src='images/newsHover.png'" width="115" height="55" alt="news" /></li>
<li id="brandsButton"> <img src="images/brands.png" onmouseout="this.src='images/brands.png'" onmouseover="this.src='images/brandsHover.png'" width="115" height="55" alt="brands" /></li>
<li id="storesButton"> <img src="images/stores.png" onmouseout="this.src='images/stores.png'" onmouseover="this.src='images/storesHover.png'" width="115" height="55" alt="stores" /></li>
<li id="careersButton"> <img src="images/careers.png" onmouseout="this.src='images/careers.png'" onmouseover="this.src='images/careersHover.png'" width="115" height="55" alt="careers" /></li>
<li id="contactButtonMenu"> <img src="images/contactButton.png" onmouseout="this.src='images/contactButton.png'" onmouseover="this.src='images/contactButtonHover.png'" width="115" height="55" alt="contact" /></li>
<li id="shopNowButton"> <img src="images/shopNowHover.png" width="114" height="53" alt="Shop Now" /> </li>
</ul>
这是我的 JS Fiddle 链接:http://jsfiddle.net/GHHJM/
【问题讨论】:
-
请贴出有问题的代码示例,以便问题更简洁。
-
@John Strickler - 我提供了相关的网站,因此代码都在那里,除了我只有设计草图。
标签: javascript jquery html css menu