Showing posts with label menu navigation. Show all posts
Showing posts with label menu navigation. Show all posts

Sunday, January 22, 2012

animated navigation menu

Animated Navigation Menu


DEMO


Changing the position of the background image felt to be the best approach to creating the type of effect we're looking for.
jQuery is a great library for this type of task but out of the box, it can't animate background position properly because of the need to animate two values instead of just one (too bad not all browsers implemented the non-standard background-position-x and -y like Internet Explorer).

The HTML


Nobody likes adding extra HTML to pull off all the fancy stuff and therefore, we're looking at a very simple unordered list

<ul>
 <li><a href="#">Home</a></li>
 <li><a href="#">About</a></li>
 <li><a href="#">Contact</a></li>
</ul>

The Basic CSS



For this, I've just floated the navigation and set each of the links to display block with a little padding. Nothing fancy (which is the whole point).

ul {
 list-style:none;
 margin:0;
 padding:0;
}
li {
 float:left;
 width:100px;
 margin:0;
 padding:0;
 text-align:center;
}
li a {
 display:block;
 padding:5px 10px;
 height:100%;
 color:#FFF;
 text-decoration:none;
 border-right:1px solid #FFF;
}
li a {
 background:url(bg.jpg) repeat 0 0;
}
li a:hover {
 background-position:50px 0;
}

Notice that a hover state has been declared. Users who visit the page without JavaScript will, at least, still be able to view the final state. I've declared the background on the li a separately to make it stand out, but an initial background position needs to be set along with the background image you want to use for the effect.




Figure 1: The Swipe
In Figure 1, the before and after states are on the left and right but a simple slant can create an interesting effect.



Figure 2: The FadeFigure 2 is a little more elaborate. The amount of visible space in the normal and hover states are at the very top and bottom of the image. The large gradient in the middle generates a fade-in/out effect when animated over time. The larger the gradient, the less it'll feel like it's moving in from the bottom and feel more like it's actually fading in and out.The simplicity of the image allows the file size to be small, as well. More complex animations with more colour depth would require a larger file size. Always strike a balance between the effect and performance.
The ScriptFinally, the script to put this altogether is really straightforward. The animation needs to run when the user moves their mouse over and out of the navigation.

$('#nav a') .
css( {backgroundPosition: "0 0"} )
 .mouseover(function(){ $(this)
.stop().animate( {backgroundPosition:"(0 -250px)"}, 
 {duration:500}) })
 .mouseout(function()
{ $(this).stop()
.animate( {backgroundPosition:"(0 0)"}, 
 {duration:500}) }) 

 The elements are captured via the $ function and given a default CSS. This is necessary for both Internet Explorer and Firefox 2, which don't report the default background position. In IE, you can get around the issue using background-position-x and -y but it's easier just to set the initial values in the script.Then the elements are animated using the mouseover and mouseout events.The key thing to note is that any animation is stopped before attempting to animate again. This avoids animations queuing up from repeatedly moving the mouse in and out of the element.jQuery also has a hover method which can be used instead of separately using the mouseover and mouseout methods. The reason I didn't was because I like the clarity that is provided by explicitly declaring them. The hover method takes two parameters: the function to run when over and the function to run when out.

Wednesday, November 23, 2011

how to add black dropdown horizontal menu

how to add black dropdown horizontal menu for your blogger




1. Log In to your blog's Edit HTML _

2. Check Expand Widget Templates and First Backup your template

3. Find CODE ]]></ b: skin>

Now enter the CSS code!

Under the code you put in this box Before Or Above code ]]></ b: skin>



#menu {
  width: 960px;
  height: 50px;
  clear: both;
}

ul#nav {
  float: left;
  width: 960px;
  margin: 0;
  padding: 0;
  list-style: none;
  background:#222222 url() repeat-x;
  -moz-border-radius-topright: 10px;
  -webkit-border-top-right-radius: 10px;
  -moz-border-radius-topleft: 10px;
  -webkit-border-top-left-radius: 10px;  
 -moz-border-radius-bottomright: 10px;
  -webkit-border-bottom-right-radius: 10px;
  -moz-border-radius-bottomleft: 10px;
  -webkit-border-bottom-left-radius: 10px;
}

ul#nav li {
  display: inline;
}

ul#nav li a {
  float: left;
  font: bold 1.1em arial,verdana,tahoma,sans-serif;
  line-height: 50px;
  color: #fff;
  text-decoration: none;
  text-shadow: 1px 1px 1px #880000;
  margin: 0;
  padding: 0 10px;
  background: # url(../img/menu-parent.png) repeat-x;
  -moz-border-radius-topright: 10px;
  -webkit-border-top-right-radius: 10px;
  -moz-border-radius-topleft: 10px;
  -webkit-border-top-left-radius: 10px;    
 -moz-border-radius-bottomright: 10px;
  -webkit-border-bottom-right-radius: 10px;
  -moz-border-radius-bottomleft: 10px;
  -webkit-border-bottom-left-radius: 10px; 
}

/* ACTIVE*/
ul#nav .current a, ul#nav li:hover > a  {
  color: #fff;
  text-decoration: none;
  text-shadow: 1px 1px 1px #330000;
  background:;
  -moz-border-radius-topright: 10px;
  -webkit-border-top-right-radius: 10px;
  -moz-border-radius-topleft: 10px;
 -moz-border-radius-bottomright: 10px;
  -webkit-border-bottom-right-radius: 10px;
  -moz-border-radius-bottomleft: 10px;
  -webkit-border-bottom-left-radius: 10px;  
}

/* LIST Sub Menu hidden by default */
ul#nav  ul {
  display: none;
}

/* WHEN THE FIRST LEVEL MENU ITEM hovering, THE CHILDREN MENU APPEARS */
ul#nav li:hover > ul {
  position: absolute;
  display: block;
  width: 920px;
  height: 30px;
  position: absolute;
  margin: 30px 0 0 0;
  background: url(../img/menu-child.png) repeat-x;  
  -moz-border-radius-bottomright: 10px;
  -webkit-border-bottom-right-radius: 10px;
  -moz-border-radius-bottomleft: 10px;
  -webkit-border-bottom-left-radius: 10px; 
}

ul#nav li:hover > ul li a {
  float: left;
  font: bold 1.1em arial,verdana,tahoma,sans-serif;
  line-height: 20px;
  color: #f4f6f7;
  text-decoration: none;
  text-shadow: 1px 1px 1px #110000;
  margin: 3px;
  padding: 5px;
  background:#222222 url(../img/menu-child.png) repeat-x; 
}

ul#nav li:hover > ul li a:hover {
  color: #0cb3ea;
  text-decoration: none;
  text-shadow: none;
}




Stage Your Next Stay enter its Html Code



<div id='menu'>
<ul id='nav'>
<li><a href='http://blogtoquick.blogspot.com/'>Home</a>
 <ul>
 </ul>
</li> 
<li><a href='http://blogtoquick.blogspot.com/p/contac-me.html'>Contac Me</a>
 <ul>
 </ul>
</li> 
<li><a href='#'>Free tols css >></a>
 <ul>
 <li><a href='#'>CSS Buttonmaker</a></li>
 <li><a href='#'>CSS 3 click Chart</a></li>
 <li><a href='#'>CSS Compressor</a></li>
 </ul>
</li>

<li><a href='#'>Backlink</a>
 <ul>
 <li><a href='#'>100 free auto backlinks</a></li>
 <li><a href='#'>Backlink generator</a></li>
 </ul>
</li>

<li><a href='#'>Site Map</a>
 <ul>
 </ul>
</li> 
</ul>

</div>


Copy the code before the tag <div class='clearfix' id='content'> 
change : http://blogtoquick.blogspot.com/ with your home Url


note:
blue color is the title of your menu
and red is the color of your URL




Note:if you did not find the code: <div class='clearfix' id='content'> Your search for content you post code


Friday, November 18, 2011

how to add vertikal slide dancing

how to add vertikal menu slide dancing


DEMO



This menu is perfect slide dancing in place disidebar your blog is fairly easy to install you just follow these steps:


1.Log in to your blogger dashboard
2.Go to --> layout- -> Edit HTML
3.Scroll down to where you see this:
]]></b:skin>
4.Now add below code just before ]]></b:skin> tag .


/**
 * Name: Nice Menu
 * Version: 0.1
 * Author:Hendrytha
**/
ul.nice-menu {
  list-style: none;
  margin-top: 30px;
  width: 300px;
}

@-moz-keyframes expand {  
  0% {
    width: 5px;
    padding-left: 0px;
  }
  
  100% {
    width: 200px;
    padding-left: 20px;
  }
}

@-moz-keyframes expand-bounce {
  0% {
    width: 5px;
    padding-left: 0px;
  }
  
  50% {
    width: 200px;
  }
  
  70% {
    width: 170px;
  }
  
  80% {
    width: 200px;
  }
  
  90% {
    width: 190px;
  }
  
  100% {
    width: 200px;
    padding-left: 20px;
  }
}

@-webkit-keyframes expand {  
  0% {
    width: 5px;
    padding-left: 0px;
  }
  
  100% {
    width: 200px;
    padding-left: 20px;
  }
}

@-webkit-keyframes expand-bounce {  
  0% {
    width: 5px;
    padding-left: 0px;
  }
  
  50% {
    width: 200px;
  }
  
  70% {
    width: 170px;
  }
  
  80% {
    width: 200px;
  }
  
  90% {
    width: 190px;
  }
  
  100% {
    width: 200px;
    padding-left: 20px;
  }
}

@-moz-keyframes shrink {
  
  0% {
    width: 200px;
    padding-left: 20px;
  }
  
  100% {
    width: 5px;
    padding-left: 0px;
  }
}

@-moz-keyframes shrink-bounce {
  
  0% {
    width: 200px;
    padding-left: 20px;
  }
  
  50% {
    width: 5px;
  }
  
  70% {
    width: 35px;
  }
  
  80% {
    width: 5px;
  }
  
  90% {
    width: 15px;
  }
  
  100% {
    width: 5px;
    padding-left: 0px;
  }
}

@-webkit-keyframes shrink {
  
  0% {
    width: 200px;
    padding-left: 20px;
  }
  
  100% {
    width: 5px;
    padding-left: 0px;
  }
}

@-webkit-keyframes shrink-bounce {
  
  0% {
    width: 200px;
    padding-left: 20px;
  }
  
  50% {
    width: 5px;
  }
  
  70% {
    width: 35px;
  }
  
  80% {
    width: 5px;
  }
  
  90% {
    width: 15px;
  }
  
  100% {
    width: 5px;
    padding-left: 0px;
  }
}

ul.nice-menu li {
  width: 5px;
  height: 30px;
  line-height: 20px;
  padding: 0px 0px 0px 0px;
  margin-top: 3px;
  background: transparent;
  width: 5px;
}

ul.nice-menu.tight li {
  margin-top: 0 !important;
}

ul.nice-menu li {
  -moz-animation-name: shrink;
  -moz-animation-duration: 0.5s;
  -moz-animation-timing-function: ease-in-out;
  -webkit-animation-name: shrink;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-timing-function: ease-in-out;
}

ul.nice-menu.bounce li {
  -moz-animation-name: shrink-bounce;
  -moz-animation-duration: 0.5s;
  -moz-animation-timing-function: ease-in-out;
  -webkit-animation-name: shrink-bounce;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-timing-function: ease-in-out;
}

ul.nice-menu li:hover {
  width: 200px;
  padding-left: 20px;
  -moz-animation-name: expand;
  -moz-animation-duration: 0.5s;
  -moz-animation-timing-function: ease-in-out;
  -webkit-animation-name: expand;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-timing-function: ease-in-out;
}

ul.nice-menu.bounce li:hover {
  -moz-animation-name: expand-bounce;
  -moz-animation-duration: 0.5s;
  -moz-animation-timing-function: ease-in-out;
  -webkit-animation-name: expand-bounce;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-timing-function: ease-in-out;
}

ul.nice-menu a {
  width: 200px;
  text-decoration: none;
  font-size: 14px;
  color: #FFF;
  text-shadow: 0px 0px 3px #333;
  font-weight: bold;
  position: absolute;
  padding: 5px 0px;
  padding-left: 20px;
}

ul.nice-menu li.green {
  background: rgb(107,186,112);
}

ul.nice-menu li.blue {
  background: rgb(78,92,127);
}

ul.nice-menu li.orange {
  background: rgb(216,121,40);
}

ul.nice-menu li.dark {
  background: rgb(42,32,30);

ul.nice-menu li.red {
  background: rgb(178,59,30);
}


ul.nice-menu li.bright {
  background: rgb(241,249,210);
}




5.Click on "Save Templates" and now you are done.

NEXT STEP

Login to your blogger dashboard and go to Desing --&-- Page Elements.

.Click on 'Add a Gadget' on the sidebar.

Select 'HTML/Javascript' and add the one of code given below



<ul class="nice-menu">
<li class="orange"><a href="">Home</a></li>
<li class="red"><a href="">About</a></li>
<li class="green"><a href="">Portfolio</a></li>
<li class="blue"><a href="">Blog</a></li>
<li class="bright"><a href="">Contact</a></li>
<li class="dark"><a href="">What not?</a></li>
</ul>