• Home
  • Services
  • Profile
  • Portfolio
  • Contact
  • Links
  • Blog
  • Archives
  • Sitemap
Subscribe: Posts | Comments | E-mail
  • Ajax
  • Design
  • Development
  • Freebies
  • IT News
  • Miscellaneous
  • Programming
  • Tutorials
  • Web 2.0

Bali Web Design

Posted on October 13, 2008 - by webmaster

Horizontal Slide Nav Using Jquery & CSS

Freebies Tutorials Web 2.0

Once i want to create icon based navigation with few lines text on it, but rather than to use tooltips i prefer to have show/hide effects, to hide the text and show it on mouse hover, and here is the result, like the effects? well just copy paste the snipet below, and you could customize it to match your taste and needs.

HTML Structures

<ul>
    <li><a href="#" title="" class="home"><p><strong>Title</strong><br />Detail</p></a></li>
    <li><a href="#" title="" class="blog"><p><strong>Title</strong><br />Detail</p></a></li>
    <li><a href="#" title="" class="services"><p><strong>Title</strong><br />Detail</p></a></li>
    <li><a href="#" title="" class="portfolio"><p><strong>Title</strong><br />Detail</p></a></li>
</ul>

Stylesheet

body{
	font:italic 0.8em/0.8em Georgia, "Times New Roman", Times, serif;
	color:#999; padding:50px;
	text-align:center;
	background:white;
}
ul{
	list-style: none;
	margin:10px 0px;
	padding: 0;
}
ul li{
	padding: 0px;
	margin:0 2px 0 0;
	list-style:none;
	display:inline;
}
ul li a{
	display: inline-block!important;
	overflow: hidden;
	height: 90px;
	line-height:90px;
	width: 128px;
	white-space:nowrap;
	text-align:left;
}
ul li a p {
	padding:0 0 0 135px;
	line-height:normal;
}
ul li a p strong {
	font-size:24px;
	color:#336600;
}
ul li a.home {
	background:url(images/chazzuka.jpg) top left no-repeat;
}
ul li a.blog {
	background:url(images/blog.jpg) top left no-repeat;
}
ul li a.services {
	background:url(images/services.jpg) top left no-repeat;
}
ul li a.portfolio {
	background:url(images/portfolio.jpg) top left no-repeat;
}

Javascript

$(function(){
	/*
		Jquery Horizontal Slide Navigation
		webmaster@chazzuka.com

http://www.chazzuka.com

		October 8th 2008 @ Denpasar, Bali Paradise Island
	*/
    $("ul li a").each(function(){
	$(this).hover(function(){
		$(this).animate({width: "400px"}, {queue:false, duration:450});
      },function() {
		  $(this).animate({width: "128px"}, {queue:false, duration:450});
	  });
    });
});

Ofcourse you need to load jquery library before javascript block above, and you can have easing effect on it as well, for that you need to load jquery easing plugin before the javascript block, to have the easing effects you need to change the javascript block as below:

$(function(){
	/*
		Jquery Horizontal Slide Navigation
		webmaster@chazzuka.com

http://www.chazzuka.com

		October 8th 2008 @ Denpasar, Bali Paradise Island
	*/
    $("ul li a").each(function(){
	$(this).hover(function(){
		$(this).animate({width: "400px"}, {queue:false, duration:450,easing:'easing_on_mousein'});
      },function() {
		  $(this).animate({width: "128px"}, {queue:false, duration:450,easing:'easing_on_mouseout'});
	  });
    });
});
Share this article:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Ping.fm
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • TwitThis
This entry was posted on Monday, October 13th, 2008 at 23:15 and is filed under Freebies, Tutorials, Web 2.0. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

16 Comments

We'd love to hear yours!



  1. Visit My Website

    October 13, 2008

    Permalink

    developer.web.id freelance web developer portfolio said:

    [...] Horizontal Slide Nav Using Jquery & CSS [...]



  2. Visit My Website

    October 23, 2008

    Permalink

    Charles said:

    I tried to write a jquery code to do this myself, and it looked great until I previewed it in Safari browser. Your works better, but doesn’t look right. The boxes in your demo aren’t all lined up nice and pretty.



  3. Visit My Website

    October 31, 2008

    Permalink

    Omid said:

    Very good :)
    I was looking it for 1 year !
    Thanks



  4. Visit My Website

    October 31, 2008

    Permalink

    Omid said:

    Hi again ;

    Could you please tell me how can I make this “Horizontal Slide Nav” width static (without any change) ? I mean on mouse over , images move on each other to remain slide nav width fixed .

    Thanks



  5. Visit My Website

    November 6, 2008

    Permalink

    Kasun said:

    Thanks a lot, I was looking for this. It works nice. Thanks



  6. Visit My Website

    November 13, 2008

    Permalink

    Jquery Vertical Slide (Dropdown) Navigation said:

    [...] have sometimes today to play around with jquery horizontal slide navigation (horizontal accordion navigation) (demo), I want to make it slide vertically, and here is what i have [...]



  7. Visit My Website

    December 15, 2008

    Permalink

    David Calhoun said:

    Wow, this is an awesome effect! What’s more impressive is the few lines of code that run it (well, after you have JQuery and the easing plugin of course). Very slick effect. Thanks for sharing!



  8. Visit My Website

    January 14, 2009

    Permalink

    Jamie said:

    Is it possible to have the first option default to open?



  9. Visit My Website

    January 16, 2009

    Permalink

    Jamie said:

    Also, is it possible to have a link inside where the text is? right now it breaks the block area.



  10. Visit My Website

    April 9, 2009

    Permalink

    40 Exceptional jQuery Interface Techniques and Tutorials said:

    [...] 40. Horizontal Slide Nav Using jQuery & CSS [...]



  11. Visit My Website

    September 4, 2009

    Permalink

    what said:

    where is the demo?



  12. Visit My Website

    September 17, 2009

    Permalink

    Adam said:

    This is a great effect. I want to include it in my portfolio site. However, it’s not W3 validated. Any thoughts on how to debug it?



  13. Visit My Website

    October 3, 2009

    Permalink

    40 Exceptional jQuery Interface Techniques and Tutorials | 9Tricks.Com – Tips – Tricks – Tutorials said:

    [...] 40. Horizontal Slide Nav Using jQuery & CSS [...]



  14. Visit My Website

    December 4, 2009

    Permalink

    40+ jQuery Plugins Improving Your Website Look and Feel | tripwire magazine said:

    [...] Horizontal Slide Nav Using jQuery & CSS [...]



  15. Visit My Website

    December 9, 2009

    Permalink

    orionrush said:

    a demo would be great!
    That way we can assess the WC3 and compatibility issues without having to recreate your work.

    Then we can give you tips, and then you can implement them, and then you look like (more of) a rock star.

    cheers!



  16. Visit My Website

    January 11, 2010

    Permalink

    40 Exceptional jQuery Interface Techniques and Tutorials « PSD to HTML , Slicing PSD to HTML said:

    [...] 40. Horizontal Slide Nav Using jQuery & CSS [...]



Leave a Comment

Here's your chance to speak.

  1. Name (required)

    Mail (required)

    Website

    Message

  • Ad Ad Ad Ad
  • Recommended Links

  • Featured News

    • PHP Class Create Short URL via TinyURL, Is.gd, Hex.io, Tr.im & Bit.ly API by webmaster on September 24, 2009
    • How to embed plurk status in wordpress blog by ruby on September 12, 2009
    • Website Optimization Best Practices, speed up your website load by ruby on May 21, 2009
    • Prism Firefox Extension, bring your web apps to the desktop by ruby on May 11, 2009
    • Troubleshoots During Migration by webmaster on March 7, 2009
  • Latest Entry

    • PHP Class Create Short URL via TinyURL, Is.gd, Hex.io, Tr.im & Bit.ly API
    • How to embed plurk status in wordpress blog
    • Scripty2 the successor of script.aculo.us
    • Social Network Icon Pack
    • jQuery validation engine, jquery inline form validation
  • Tag Cloud

    • Actionscript advertorial Ajax API best practices chat Classic ASP CMS CSS Design Development facebook firefox Flash flickr Freebies gmail HTML icons Javascript Jobs jQuery jQuery Plugins Library Lightbox Mootools news Personal PHP plurk prism Prototype regex regular expression Scriptaculous SEO Tutorial twitter Web 2.0 Wordpress Works YUI
  • Most Popular Posts

    • { 80 } ResponsesPHP ajax login form using Jquery
    • { 79 } Responsesphp ajax tutorial create ajax based login form using jquery
    • { 59 } ResponsesASP Classic Programming Still Alive
    • { 52 } Responses63+ best practice to optimize PHP code performances
    • { 38 } ResponsesVideobox: Lightbox for videos
© 2007 - 2010 Bali Web Design all rights reserved
Powered by wordpress Theme by woothemes