jquery implements a dynamic sliding menu for blogs _jquery

Source: Internet
Author: User
Tags extend

This article illustrates the way jquery implements a dynamic sliding menu that can be used for blogs. Share to everyone for your reference. Specifically as follows:

Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title>jquery Sliding Menu Plugin </title>
<script type= "Text/javascript" src= "Js/jquery1.3.2.js" ></script>
<script type= "Text/javascript" >
(function ($) {
$.fn.extend ({
Tagdrop:function (options) {
var defaults = {
Tagpaddingtop: ' 90px ',
Tagdefaultpaddingtop: ' 30px ',
bgcolor: ' #B1CCED ',
Bgmovercolor: ' #7FB0F0 ',
TextColor: ' #e0e0e0 ',
Textdefaultcolor: ' #fff '
};
var options = $.extend (defaults, options);
Return This.each (function () {
var obj = $ (this);
var Li_items = $ ("li", obj);
$ ("li", obj). css (' Background-color ', options.bgcolor);
Li_items.mouseover (function () {
$ (this). Animate ({PaddingTop:options.tagPaddingTop}, 300);
$ (this). CSS (' Background-color ', options.bgmovercolor);
$ (this). CSS (' color ', options.textcolor);
}). mouseout (function () {
$ (this). Animate ({PaddingTop:options.tagDefaultPaddingTop}, 500);
$ ("Li", $ (this). Parent ()). CSS (' Background-color ', options.bgcolor);
$ ("Li", $ (this). Parent ()). CSS (' color ', options.textdefaultcolor);
});
});
}
});
}) (JQuery);
</script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ('. Menu '). Tagdrop ({tagpaddingtop: ' 60px ', bgcolor: ' #B1CCED ', Bgmovercolor: ' #7FB0F0 ', TextColor: ' #e0e0e0 '});
});
</script>
<style>
Body {
margin:0;
padding:0;
}
#nav li {margin:0; padding:0;display:inline;list-style-type:none;font-size:12px;}
#nav A:link, #nav a:visited {
}
#nav a:hover {color: #fff; Background: #FF6A00;}
#nav a:visited.active, #nav a:link.active {background-color: #fff; color: #FF6A00;}
. menu {
List-style:none;
margin:0;
Float:right;
}
. menu Li {
Float:left;
margin:0 Auto;
Cursor:pointer;
height:30px;
padding:30px 5px 5px 5px;
margin:0px 3px 0px 3px;
-moz-border-radius:0px 0px 10px 10px;
-webkit-border-radius:0px 0px 10px 10px;
-moz-box-shadow:0 1px 3px Rgba (0,0,0,0.5);
-webkit-box-shadow:0 1px 3px Rgba (0,0,0,0.5);
Color: #FFF;
text-shadow:0 -1px 1px rgba (0,0,0,0.25);
font-family: "Lucida Grande", Lucida,verdana,sans-serif;
font-size:13px;
Font-weight:bold;
Text-transform:uppercase;
}
</style>
<body>
<ul class= "Menu" >
<li>about us</li>
<li>Contacts</li>
<li>Others</li>
<li>Products</li>
<li>Portfolio</li>
<li>Testemonies</li>
</ul>
</body>

I hope this article will help you with your jquery programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.