Jquery 下拉菜单动画效果
本例除了下面的这些代码还用了比较多的js文件,请看演示源码
XML/HTML Code
- <div id="container">
- <div id="navigation">
- <ul>
- <li><a href="">Home</a></li>
- <li><a href="http://www.freejs.net">freejs</a>
- <ul>
- <li><a href="http://www.freejs.net/daohangcaidan.html">导航菜单</a></li>
- <li><a href="http://www.freejs.net/tabbiaoqian.html">TAB标签</a></li>
- </ul>
- </li>
- <li><a href="/about">About</a></li>
- </ul>
- </div>
- </div>
JavaScript Code
- <script type="text/javascript">
- $(document).ready(function() {
- $("#navigation").dropSlideMenu({
- indicators: true, // adds a div to the list items for attaching indicators (arrows)
- clickstream: true, // highlights the clickstream in a menu by comparing the links to the current URL path
- openEasing: "easeOutQuad", // open animation effect
- closeEasing: "easeInQuad", // close animation effect
- duration: 600, // speed of drop down animation (in milliseconds)
- delay: 800, // delay before the drop down closes (in milliseconds)
- hideSelects: true // hide all select elements on the page when the menu is active (IE6 only)
- });
- });
- </script>
CSS Code
- /* first level > list */
- ul.ds {
- z-index: 1000;
- }
- /* first level > list items */
- ul.ds li {
- float: left;
- position: relative;
- margin: 0 0.5em 0 0;
- line-height: 1em;
- z-index: 1001;
- }
- /* first level > link style */
- ul.ds li a, ul.ds li a:visited {
- position: relative;
- display: block;
- padding: 0.7em 1em;
- line-height: 1em;
- text-decoration: none;
- color: #fff;
- background-color: #0f1923;
- }
- /* first level > link style > hover */
- ul.ds li a:hover {
- color: #5cbeff;
- background-color: #1a3855;
- }
- /* indicators */
- ul.ds li div.indicator {
- }
- ul.ds li div.indicator a {
- background-image: url("indicators.png");
- background-position: rightright 12px;
- background-repeat: no-repeat;
- }
- /* open state and hover style */
- ul.ds li.open div.indicator a, ul.ds li div.indicator a:hover {
- color: #5cbeff;
- background-color: #1a3855;
- background-position: rightright -140px;
- }
- /* second level > list */
- ul.ds li ul {
- position: absolute;
- left: 0;
- visibility: hidden;
- z-index: 1001;
- }
- /* second level > list items (override first level > list items) */
- ul.ds li ul li {
- float: none;
- margin: 0;
- /*display: inline;*/
- }
- /* second level > link style */
- ul.ds li ul li a, ul.ds li ul li a:visited {
- padding: 0.5em 1em;
- color: #eee !important;
- background-image: none;
- background-color: #0f1923;
- border-top: 1px solid #485d72;
- }
- /* individual styling of first list link style */
- ul#dsList-1 li a, ul#dsList-1 li a:visited {
- background-color: #5c0000;
- border-top: 1px solid #a74242;
- }
- /* second level > link style > hover */
- ul.ds li ul li a:hover {
- color: #ff91df !important;
- background-color: #480b36 !important;
- }
- /* clickstream */
- ul.ds li.clickstream a {
- color: #5cbeff;
- }
- ul.ds li.clickstream div.indicator a {
- background-position: rightright -64px;
- }
- ul.ds li.open.clickstream div.indicator a, ul.ds li.clickstream div.indicator a:hover {
- background-position: rightright -140px;
- }
- ul.ds li ul li.clickstream a {
- color: #5cbeff !important;
- background-color: #000 !important;
- }
- /* list item widths */
- li#dsListItem-1 {
- width: 7em;
- }
- li#dsListItem-2 {
- width: 10em;
- }
- li#dsListItem-3 {
- width: 7em;
- }
- /* list widths */
- ul#dsList-1 {
- width: 7em;
- }
- ul#dsList-2 {
- width: 10em;
- }
- ul#dsList-3 {
- width: 9em;
- }
- div.dsClear { /* to clear the floated list items */
- clear: both;
- height: 0;
- font-size: 0;
- line-height: 0;
- }
相关推荐
周公周金桥 2020-09-06
大象从不倒下 2020-07-31
AlisaClass 2020-07-19
MaureenChen 2020-04-21
xingguanghai 2020-03-13
teresalxm 2020-02-18
木四小哥 2013-05-14
SoShellon 2013-06-01
Simagle 2013-05-31
羽化大刀Chrome 2013-05-31
waterv 2020-01-08
LutosX 2013-07-29
vanturman 2013-06-27
wutongyuq 2013-04-12
luoqu 2013-04-10
today0 2020-09-22
89520292 2020-09-18
bigname 2020-08-25