You need to sign in to do that
Don't have an account?
Highlight the commandlink when onclick
Hi
Insted of Tab panel i am using command link. My Problem is once the user click the commandlink it should highlighted like tab's. I have tried in CSS and Java Script. Its not working. Here i am rerender the whole page. Please any one help.
Thanks in Advance.
<div class="header_style">
<ul>
<li><a href="#">Vendor</a></li>
<li >
<apex:commandLink value="Hot Deals" action="{!Set_Deals}" >
<apex:param name="deals" value="Hot_Deals"/>
</apex:commandLink>
</li>
<li>
<apex:commandLink value="Limited Period Deals" action="{!Set_Deals}" >
<apex:param name="deals" value="Limited_Deals"/>
</apex:commandLink>
</li>
<li>
<apex:commandLink value="General Products" action="{!Set_Deals}" >
<apex:param name="deals" value="General_Deals"/>
</apex:commandLink>
</li>
</ul>
</div>
CSS
.header_style ul
{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
font-family: 'Arial', sans-serif;
font-size: 12px;
background-color:#45b3e0;
height:28px;
}
.header_style li
{
float:left;
padding-left:30px;
width:150px;
}
.header_style a:link,a:visited
{
display:block;
color:#FFFFFF;
background-color:#45b3e0;
text-align:center;
padding:5px;
text-decoration:none;
}
.header_style a:hover,a:active
{
color:#000000;
background-color:#45a6e0;
border:1px solid #1e8bb7;
text-decoration:none;
}
Hello,
You are right this can be acieved either by JS or jQuery. Please refer following liknks:
http://stackoverflow.com/questions/813046/jquery-highlight-the-link-when-clicked
http://www.webdeveloper.com/forum/showthread.php?191102-li-onclick-highlight
http://forums.phpfreaks.com/topic/36051-solved-how-to-highlight-selected-link/
http://stackoverflow.com/questions/12306774/highlighting-onclick-menu-link
Hello
Thanks for your help.
But I have used your second link. What is the problem is i am rerendering the whole page. So again the tab highlighted has gone. That is the problem...
Thanks in Advance