I have used "List subpages by level" template to create a Navigation bar. I have used css to convert the <Li > elements to horizontal navigation bar. I have given background color to the navigation bar. Now i have a requirement where i need to change the color of the selected tab in the navigation bar. I am able to change the color on mouse hover event but not able to change is completely.
Please suggest me the solution. I think we could do something with javascript. If yes please copy the code for me or suggest some references.
<xsl:text disable-output-escaping="yes"> function pageselectCallback(page_index, jq){ var items_per_page = 5; var max_elem = Math.min((page_index+1) * 5, content.length); var newcontent = '';
How to use javascript in xslt
Hi Team,
I have used "List subpages by level" template to create a Navigation bar. I have used css to convert the <Li > elements to horizontal navigation bar. I have given background color to the navigation bar. Now i have a requirement where i need to change the color of the selected tab in the navigation bar. I am able to change the color on mouse hover event but not able to change is completely.
Please suggest me the solution. I think we could do something with javascript. If yes please copy the code for me or suggest some references.
Have a look at this: http://our.umbraco.org/wiki/reference/xslt/extend-your-xslt-with-custom-functions
Instead of using C#, you can use Javascript if you wish.
I don't believe that you can use javascript as of Umbraco 4
You can, e.g. I placed the following code into my search xslt for paging support:
hth,
Thomas
But to have the active li marked you can do this via css and classes for the li. Or just look into the http://our.umbraco.org/projects/cogworks---flexible-navigation project
Thomas
Something like this?
<style media="all" type="text/css" >
#nav-main li{float:left; display:block; padding:0px; margin:0px; list-style:none; border-right:1px dotted #333;}
#nav-main li a{ display:block; float:left; background:#ccc; color:#000; padding:20px; }
#nav-main li a:hover{background:#000; color:#fff}
</style>
<ul id="nav-main">
<li><a href="http://google.com" >Google</a></li>
<li><a href="http://yahoo.com" >Yahoo</a></li>
<li><a href="http://bbc.co.uk" >BBC</a></li>
</ul>
is working on a reply...