2. Go to Design --> Edit HTML
3. Copy the code below, and paste above </head>
<style type='text/css'>
ul#topnav {
margin: 10px 0 20px;
padding: 0;
list-style: none;
font-size: 1.1em;
clear: both;
float: left;
width: 99%;
}
ul#topnav li{
margin: 0;
padding: 0;
overflow: hidden;
float: left;
height:40px;
}
ul#topnav a, ul#topnav span {
padding: 10px 20px;
float: left;
text-decoration: none;
color: #fff;
text-transform: uppercase;
clear: both;
height: 20px;
line-height: 20px;
background: #1d1d1d;
}
ul#topnav a { color: #7bc441; }
ul#topnav span {
display: none;
}
ul#topnav.v2 span{
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjIy55LekIks4mojTK4-NPmaJtYXKSnTfTeRf3WTvkpc9_RxwuLm0-_UTzxd-vSQehE54cjUbh2NRiyIUPd7pvUp4qDRCAMA_0tpe0kE3Y-lfBkxTajNENEW442xhf_u3-5drKoC-BGdw/) repeat-x left top;
}
ul#topnav.v2 a{
color: #555;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjIy55LekIks4mojTK4-NPmaJtYXKSnTfTeRf3WTvkpc9_RxwuLm0-_UTzxd-vSQehE54cjUbh2NRiyIUPd7pvUp4qDRCAMA_0tpe0kE3Y-lfBkxTajNENEW442xhf_u3-5drKoC-BGdw/) repeat-x left bottom;
}
</style>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function() {
$("#topnav li").prepend("<span/>"); //Throws an empty span tag right before the a tag
$("#topnav li").each(function() { //For each list item...
var linkText = $(this).find("a").html(); //Find the text inside of the a tag
$(this).find("span").show().html(linkText); //Add the text in the span tag
});
$("#topnav li").hover(function() { //On hover...
$(this).find("span").stop().animate({
marginTop: "-40" //Find the span tag and move it up 40 pixels
}, 250);
} , function() { //On hover out...
$(this).find("span").stop().animate({
marginTop: "0" //Move the span back to its original state (0px)
}, 250);
});
});
</script>
ul#topnav {
margin: 10px 0 20px;
padding: 0;
list-style: none;
font-size: 1.1em;
clear: both;
float: left;
width: 99%;
}
ul#topnav li{
margin: 0;
padding: 0;
overflow: hidden;
float: left;
height:40px;
}
ul#topnav a, ul#topnav span {
padding: 10px 20px;
float: left;
text-decoration: none;
color: #fff;
text-transform: uppercase;
clear: both;
height: 20px;
line-height: 20px;
background: #1d1d1d;
}
ul#topnav a { color: #7bc441; }
ul#topnav span {
display: none;
}
ul#topnav.v2 span{
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjIy55LekIks4mojTK4-NPmaJtYXKSnTfTeRf3WTvkpc9_RxwuLm0-_UTzxd-vSQehE54cjUbh2NRiyIUPd7pvUp4qDRCAMA_0tpe0kE3Y-lfBkxTajNENEW442xhf_u3-5drKoC-BGdw/) repeat-x left top;
}
ul#topnav.v2 a{
color: #555;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjIy55LekIks4mojTK4-NPmaJtYXKSnTfTeRf3WTvkpc9_RxwuLm0-_UTzxd-vSQehE54cjUbh2NRiyIUPd7pvUp4qDRCAMA_0tpe0kE3Y-lfBkxTajNENEW442xhf_u3-5drKoC-BGdw/) repeat-x left bottom;
}
</style>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function() {
$("#topnav li").prepend("<span/>"); //Throws an empty span tag right before the a tag
$("#topnav li").each(function() { //For each list item...
var linkText = $(this).find("a").html(); //Find the text inside of the a tag
$(this).find("span").show().html(linkText); //Add the text in the span tag
});
$("#topnav li").hover(function() { //On hover...
$(this).find("span").stop().animate({
marginTop: "-40" //Find the span tag and move it up 40 pixels
}, 250);
} , function() { //On hover out...
$(this).find("span").stop().animate({
marginTop: "0" //Move the span back to its original state (0px)
}, 250);
});
});
</script>
4. Click SAVE TEMPLATE
5. Now add the code below, to use red sliding horizontal menu
[Design --> Page Elements --> Add Gadget, choose "HTML/Java Script"]
<div class="container">
<ul id="topnav" class="v2">
<center>
<li><a href="#">Home</a></li>
<li><a href="#">TOC</a></li>
<li><a href="#">Widgets</a></li>
<li><a href="#">Templates</a></li>
<li><a href="#">jQuery</a></li>
<li><a href="#">Advertise</a></li>
<li><a href="#">Contact</a></li>
</center>
</ul>
</div>
6. Before you click SAVE, don't forget to customize the links
<ul id="topnav" class="v2">
<center>
<li><a href="#">Home</a></li>
<li><a href="#">TOC</a></li>
<li><a href="#">Widgets</a></li>
<li><a href="#">Templates</a></li>
<li><a href="#">jQuery</a></li>
<li><a href="#">Advertise</a></li>
<li><a href="#">Contact</a></li>
</center>
</ul>
</div>
No comments:
Post a Comment