|
|||
|
How to set current menu style
Hi,
iam try to set style to current menu,how to set style to current menu? iam write focus attribute in css.but its not working.any one help me. HTml Code: HTML Code:
<div class="urbangreymenu"> <ul> <li><a href="#">Design</a></li> <li><a href="#">Analysis</a></li> <li><a href="#">FMEA</a></li> <li><a href="#">CAD</a></li> <li><a href="#">NPI</a></li> <li><a href="#">Contract</a></li> </ul> </div> CSS Code : HTML Code:
<style type="text/css"> .urbangreymenu{ width: 210px; /*width of menu*/ margin-top:25px; } .urbangreymenu .headerbar{ font: bold 13px Verdana; color: white; background: #606060 url(media/arrowstop.gif) no-repeat 8px 6px; /*last 2 values are the x and y coordinates of bullet image*/ margin-bottom: 0; /*bottom spacing between header and rest of content*/ text-transform: uppercase; padding: 7px 0 7px 31px; /*31px is left indentation of header text*/ } .urbangreymenu ul{ list-style-type: none; margin: 0; padding: 0; margin-bottom: 0; /*bottom spacing between each UL and rest of content*/ } .urbangreymenu ul li{ padding-bottom: 2px; /*bottom spacing between menu items*/ } .urbangreymenu ul li a{ font: normal 12px Arial; color: black; display: block; padding: 7px 0; line-height: 17px; padding-right: 15px; /*link text is indented 8px*/ text-decoration: none; text-align:right; } .urbangreymenu ul li a:focus { padding-right: 15px; color: red; background-image:url(images/lefthover.jpg); background-repeat:no-repeat; } #current{ padding-right: 15px; color: black; background-image:url(images/lefthover.jpg); background-repeat:no-repeat; } .urbangreymenu ul li a:hover{ /*hover state CSS*/ padding-right: 15px; color: red; font-weight:bold; background-image:url(images/lefthover.jpg); background-repeat:no-repeat; } </style> Thanks, Megabyte Last edited by megabyte; 05-22-2009 at 04:26 AM. |
| Sponsored Links |
|
|||
|
Use this Javascript Function
add this java script in header section.willl you change your CSS id in java script whatever you want HTML Code:
function extractPageName(hrefString)
{
var arr = hrefString.split('/');
return (arr.length<2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();
}
function setActiveMenu(arr, crtPage)
{
for (var i=0; iYour HTML code set like this HTML Code:
<div id="urbangreymenu"> <ul> <li><a href="#">Text</a></li> <li><a href="#">Text</a></li> <li><a href="#">Text</a></li> <li><a href="#">Text</a></li> <li><a href="#">NPI</a></li> <li><a href="#">Text</a></li> </ul> <script language="javascript">setPage()</script> </div> |
|
|||
|
code is missing in above post
PHP Code:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| Comp.Sys.Acorn.FAQ part 1 of 4 | Paul Vigay | Tech FAQ | 0 | 05-31-2004 09:00 PM |
| Comp.Sys.Acorn.FAQ part 1 of 4 | Paul Vigay | Tech FAQ | 0 | 04-30-2004 09:00 PM |
| Solaris x86 FAQ 2/2 | Dan Anderson | Tech FAQ | 0 | 04-27-2004 08:24 PM |
| [FAQ] FileMaker Pro - database for Macintosh and Windows | Martin Trautmann | Tech FAQ | 0 | 04-17-2004 08:26 AM |