2015-09-22 49 views
0
<html> 
<body> 
<div id="navi"> 
<ul width="100%" align="center" style="padding-top:20px; display:inline"> 
<li>  
<a style="font-size:25px; color:#0ff; padding-top:20px; font-weight:bold;" href="corporate_frame.html" target="load">Corporate</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</li> 
<li>  
<a style="font-size:25px; color:#0ff; font-weight:bold" href="security_frame.html" target="load">Security</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</li> 
<li> 
<a style="font-size:25px; color:#0ff; font-weight:bold" href="driver_frame.html" target="load">Driver</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</li> 
<li> 
<a style="font-size:25px; color:#0ff; font-weight:bold" href="medical_frame.html" target="load">Medical</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</li> 
<li> 
<a style="font-size:25px; color:#0ff; font-weight:bold" href="engineering_frame.html" target="load">Engineering</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</li> 
<li> 
<a style="font-size:25px; color:#0ff; font-weight:bold" href="hospitality_frame.html" target="load">Hospitality</a> 
</li> 
</ul>//closing tag of un order list 
<br> 
<br> 

<iframe src="corporate_frame.html" style="height:250px; width:1310px; border:none;" name="load"></iframe> 


</div> 
</body> 
</html> 

所以告诉我,当点击“公司”或任何其他链接时,链接的颜色应该改变,直到另一个链接打开。如何在iframe中打开链接时更改菜单链接颜色?

+0

,可以在运行中jsfiddle.net –

+0

代码是的,我可以运行它,但我只需要CSS或我的问题javascript代码 – Sham

+0

OK看到我的答案先生 –

回答

0

我不知道这会工作,但我认为它会:

.menulink 
{ 
    color: #0000FF; 
    cursor: pointer; 
} 

.menulink:hover 
{ 
    color: #FF0000; 
    cursor: pointer; 
} 

See the link

0

你已经没有太多见解,你想如何实现这一点,但下面是一个jQuery解决方案。我也猜测你只是试图在菜单上显示“活动”链接?

$("div#navi a").each(function() 
{ 
     $(this).bind("click", function() 
     { 
      // Reset other link colors to "#0ff" 
      $("div#navi a").css("color", "#0ff"); 

      // Change color for this link to "blue" 
      $(this).css("color", "blue"); 
     }); 
});