<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>mouse</title>
</head>
<body>
<img src = "http://www.autoweekly.com.au/aw/attachment/mini/e8e5e91ad9.jpg" name = "myimage"/>
<br/>
<a href = "http://www.zhsite.net"  onclick = "window.document.myimage.src = 'http://www.autoweekly.com.au/aw/attachment/mini/879800d035.jpg'; return false;";>亲点击试试</a>
</body>
</html>1、我想把return false注释掉,但在事件里面好像不能用//这个来注释,可这明明是js。
2、我把a链接属性改成#号,然去去掉 return false;希望能再点这个链接的时候他能切换到之前那一张,但好像不行
能做个这个效果给我吗?

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mouse</title>
    </head>
    <body>
    <img src = "http://www.autoweekly.com.au/aw/attachment/mini/e8e5e91ad9.jpg" name = "myimage"/>
    <br/>
    <a href = "http://www.zhsite.net" onclick = "window.document.myimage.src = 'http://www.autoweekly.com.au/aw/attachment/mini/879800d035.jpg'; /*return false;*/";>亲点击试试</a>
    </body>
    </html><html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mouse</title>
    <script>
    cs = function(){
    window.document.myimage.src = 'http://www.autoweekly.com.au/aw/attachment/mini/879800d035.jpg';
    //return false;
    }
    </script>
    </head>
    <body>
    <img src = "http://www.autoweekly.com.au/aw/attachment/mini/e8e5e91ad9.jpg" name = "myimage"/>
    <br/>
    <a href = "http://www.zhsite.net" onclick = "cs()";>亲点击试试</a>
    </body>
    </html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mouse</title>
    <script>
    cs = function(){
    window.document.myimage.src = 'http://www.autoweekly.com.au/aw/attachment/mini/879800d035.jpg';
    //return false;
    }
    </script>
    </head>
    <body>
    <img src = "http://www.autoweekly.com.au/aw/attachment/mini/e8e5e91ad9.jpg" name = "myimage"/>
    <br/>
    <a href = "#" onclick = "cs()";>亲点击试试</a>
    </body>
    </html>
      

  2.   

    <html>
    <script type="text/javascript">
    function click(){
    var image = document.getElementsByTagName("img")[0];
    var alink = document.getElementsByTagName("a")[0];
    alink.setAttribute("href",image.getAttribute("src"));
    return false;
    }
    </script>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mouse</title>
    </head>
    <body>
    <img src = "http://www.autoweekly.com.au/aw/attachment/mini/e8e5e91ad9.jpg" name = "myimage"/>
    <br/>
    <a href = "http://www.zhsite.net" onclick = "return click()";>亲点击试试</a>
    </body>
    </html>
      

  3.   

    //     /*......*/      <!--....-->