一共有3个文字链接,怎样点击其中的一个链接后文字变粗,另两个不变粗?反之亦然? 
效果如http://www.4world.pl/categories/kategoria/29这个网站的产品列表,当鼠标放上去,文字链接变大,点击后,文字链接还是变大,当点击其他的文字连接后,原来点击过的文字链接恢复原形,新点击的文字链接就变粗了。谢谢

解决方案 »

  1.   

    如果单要效果的话,可以在事件下用css控制
      

  2.   

    移动 点击后连接文字变大:
    a:hover {color: red; text-decoration:underline; font-size:18px;}  
    a:visited {color:purple;text-decoration:none; font-size:18px;}点其他连接文字回复过来,用JS来控制!
      

  3.   

    楼主你的给的那个网站点击链接后url变了,就是页面刷新了,在具体的页面哪里直接把当前项的链接设置成加粗的。。如果是同一个页面需要根据参数来设置。
      

  4.   

    onclick=fucntion(this){
    document.getElementsByTagName('input')[0].style.fontWeight='normal';
    document.getElementsByTagName('input')[1].style.fontWeight='normal';
    document.getElementsByTagName('input')[2].style.fontWeight='normal';
    this.style.fontWeight='bold'; }
      

  5.   

    这个是test1.html的代码
    <table width="180" border="0" cellspacing="0" cellpadding="0">
      <tr>
         <Td height="18">
      <FONT color=#ff3300><B>&nbsp; -</B></FONT><A href="test1.htm">WebSiteA</A>   
      </tr>
        <tr>
         <Td height="18">
      <FONT color=#ff3300><B>&nbsp; -</B></FONT><A href="test2.htm">WebSiteB</A></tr>
    </table>
     您点击的是websiteA,我想用js来实现效果如http://www.4world.pl/categories/kategoria/29这个网站的产品列表,当鼠标放上去,文字链接变大,点击后,文字链接还是变大,当点击其他的文字连接后,原来点击过的文字链接恢复原形,新点击的文字链接就变粗了。谢谢这个是test2.html的代码
    <LINK href="t/Style.css" type=text/css rel=stylesheet>
    <table width="180" border="0" cellspacing="0" cellpadding="0">
      <tr>
         <Td height="18">
      <FONT color=#ff3300><B>&nbsp; -</B></FONT><A href="test1.htm">WebSiteA</A>   
      </tr>
        <tr>
         <Td height="18">
      <FONT color=#ff3300><B>&nbsp; -</B></FONT><A href="test2.htm">WebSiteB</A></tr>
    </table>
    您点击的是websiteB,我想用js来实现效果如http://www.4world.pl/categories/kategoria/29这个网站的产品列表,当鼠标放上去,文字链接变大,点击后,文字链接还是变大,当点击其他的文字连接后,原来点击过的文字链接恢复原形,新点击的文字链接就变粗了。谢谢
      

  6.   


        <A href="test1.htm" target="_blank">WebSiteA</A>
        <A href="test2.htm" target="_blank">WebSiteB</A>        var links = document.getElementsByTagName('a'), selectedLink = null;
            for (var i = 0, length = links.length; i < length; i++) {
                links[i].onmouseover = function() {
                    this.style.fontWeight = 'bold';
                }
                links[i].onmouseout = function() {
                    if(this != selectedLink) this.style.fontWeight = '';
                }
                links[i].onclick = function() {
                    if (selectedLink) selectedLink.style.fontWeight = '';
                    selectedLink = this;
                }
            }