473,473 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I have crated tab link menu in ""Magento header""...when click on link color will cha

2 New Member
I have crated tab link menu in ""Magento header""...when click on link color will change and after click on another link color change and previous link color back to original...I have created javascript and css please look ..this code work fine when we are not providing href link Thanks in Advance


HTML code::
Expand|Select|Wrap|Line Numbers
  1. <ul id="navigation"> <li><a href="http://bytes.com/submit/g/#"><span>HOME</span></a></li> <li><a href="http://bytes.com/submit/g/#"><span>ABOUT</span></a></li> <li><a href="http://bytes.com/submit/g/#"><span>CONTACT</span></a></li> </ul>

Javascript code::
Expand|Select|Wrap|Line Numbers
  1. <script>
  2.  
  3. $(function() {
  4.     $('#navigation li').click(function() {
  5.             $('#navigation li').removeClass('selected');
  6.             $(this).addClass('selected');
  7.             //$('a', this).addClass('selected');
  8.  
  9.     });
  10. });
  11. </script>
  12.  
  13.  
  14. css code::
  15.  
  16. <style type="text/css">
  17. #navigation a
  18. {
  19.     background: url("http://i52.tinypic.com/spxfdw.png") no-repeat scroll 0 0 transparent;
  20.     color: #000000;
  21.     height: 43px;
  22.     list-style: none outside none;
  23.     padding-left: 10px;
  24.     text-align: center;
  25.     text-decoration: none;
  26.     width: 116px;
  27. }
  28.  
  29. #navigation a span
  30. {
  31.     padding-right: 10px;
  32.     padding-top: 15px;
  33. }
  34.  
  35. #navigation a, #navigation a span
  36. {
  37.     display: block;
  38.     float: left;
  39.  
  40. }
  41.  
  42. /* Hide from IE5-Mac \*/
  43. #navigation a, #navigation a span
  44. {
  45.     float: none
  46. }
  47. /* End hide */
  48.  
  49. #navigation a:hover
  50. {
  51.  
  52.     background: url('http://i51.tinypic.com/2iih9c9.png') no-repeat scroll 0 0 transparent;
  53.     color: #000000;
  54.     height: 43px;
  55.     list-style: none outside none;
  56.     padding-left: 10px;
  57.     text-decoration: none;
  58.     width: 116px;
  59.     text-align:center
  60. }
  61.  
  62. #navigation a:hover span
  63. {
  64.     background: url(right-tab-hover.gif) right top no-repeat;
  65.     padding-right: 10px
  66. }
  67.  
  68. #navigation ul
  69. {
  70.     list-style: none;
  71.     padding: 0;
  72.     margin: 0
  73. }
  74.  
  75. #navigation li
  76. {
  77.     float: left;
  78.     list-style: none outside none;
  79.     margin: 0;
  80.  
  81. .selected{
  82.     border: 1px solid #888;
  83.     background-color: #white;
  84.     background-image:none;
  85. }
  86. </style>
Jun 20 '13 #1
0 1350

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mat | last post by:
How can I detect when a link has been clicked but the new page is still in the process of loading? The document.location.href property still displays the current location (understandably) not the...
4
by: elad | last post by:
Hi I'm working with HV Menu 5.5 (downloaded from www.dynamicdrive.com ) I'm using it with 2 horizontal frames. The menu works great if the FirstLineFrame and SecLineFrame are the same (The...
1
by: Jiong Feng | last post by:
Hi, I use createPopup and renders a link: var oPopBody = oPopup.document.body; oPopBody.style.backgroundColor = "lightyellow"; oPopBody.style.border = "solid black 1px"; oPopBody.innerHTML =...
4
by: Newbie | last post by:
Is it possible to set up an event handler or something else so that when *any* link on the page is clicked it 'fires-up', executes some JS and then continues to process the link that was clicked?...
1
by: Sakharam Phapale | last post by:
Hi All, How to show dropdown list of menu items just like click on Parent menu. For example, Edit (Parent menu) Cut (child menu) Copy (child menu) Paste (child menu)
2
by: Sakharam Phapale | last post by:
Hi All, How to show dropdown list of menu items just like click on Parent menu. For example, Edit (Parent menu) Cut (child menu) Copy (child menu) Paste (child menu)
1
by: avanti | last post by:
Hi, I am trying to show a context menu on a right click in some of my controls. I want to show it at the right location. However it is getting shown away from the mouse click location. Here is...
0
by: GS | last post by:
IN the application I developing, I have to deal with some https website that uses JavaScript function with parameters in link to open new window when the link is clicked. The default is that the...
2
by: simonyong | last post by:
hello, anyone.. im newbie to asp.net my problem is : My task is related to view all data from a table called "employee " i had create a datagrid where called data from database and...
3
by: simonyong | last post by:
Im a newbie to asp.net, i hav a bit dilemma when thinking about how i should let it work.. My task as below: My task is related to view all data from a table called "employee " i had create a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.