又是display:none不显示
又是打开网页就要显示
-_-!   你给说说这到底是什么逻辑 到底什么时候需要显示什么时候不显示..

解决方案 »

  1.   

    奇怪绝大数现在我都结了,怎么结帖率还是这么低
    我也不知道怎么描述,大家看tcl的网站,http://www.tcl.com/main/product/productinfo.jsp?catalogId=14071&productId=4449,其中产品信息与产品参数是通过脚本实现的,打开这个网站,默认显示
    的是产品信息,然后大家将我的代码改哈,打开该网站div层  第一条件语句自动显示,而不要你去单击才会显示
      

  2.   

    是这样么?
    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <title>无标题文档 </title> 
    <style type="text/css"> 
    <!-- 
    body,td,th { 
    font-family: 宋体; 

    --> 
    </style> </head> 
    <style> 
    #submenu{ 
    width:300px; 
    height:290px; 

    </style> 
    <body> <table width="200" border="1"> 
      <tr> 
        <td> <a href="#" onClick="best('test')">产品参数 </a> </td> 
        <td> <a href="#" onClick="best('test1')">运行环境 </a> </td> 
    </tr> 
    </table> 
    <div id="submenu"><br>信息管理</div> 
    <script language="javascript"> 
    function best(value){ 
    switch(value){ 
    case "test": 
    submenu.innerHTML="<br>信息管理"; 
    break; 
    case "test1": 
    submenu.innerHTML=" <a href='263.com'>好样的 </a>"; 
    break; 


    </script> </body> 
    </html>
      

  3.   

    是的,但是我想把代码改哈 用div display去实现我的目的.怎么改呢
      

  4.   

    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <title>无标题文档 </title> 
    <style type="text/css"> 
    <!-- 
    body,td,th { 
    font-family: 宋体; 

    --> 
    </style> </head> 
    <style> 
    #submenu{ 
    width:300px; 
    height:290px; 

    </style> 
    <body> <table width="200" border="1"> 
      <tr> 
        <td> <a href="#" onClick="best('test')">产品参数 </a> </td> 
        <td> <a href="#" onClick="best('test1')">运行环境 </a> </td> 
    </tr> 
    </table> 
    <div id="submenu"><br>信息管理</div> 
    <div id="submenu1" style="display:none"><a href='263.com'>好样的 </a></div> 
    <script language="javascript"> 
    function best(value){ 
    switch(value){ 
    case "test": 
    submenu.style.display = '';
    submenu1.style.display = 'none';
    break; 
    case "test1": 
    submenu.style.display = 'none';
    submenu1.style.display = '';
    break; 


    </script> </body> 
    </html>
      

  5.   

    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <title>无标题文档 </title> 
    <style type="text/css"> 
    <!-- 
    body,td,th { 
    font-family: 宋体; 

    --> 
    </style> </head> 
    <style> 
    #submenu{ 
    width:300px; 
    height:290px; 

    </style> 
    <body> <table width="200" border="1"> 
      <tr> 
        <td> <a href="#" onClick="best('test')">产品参数 </a> </td> 
        <td> <a href="#" onClick="best('test1')">运行环境 </a> </td> 
    </tr> 
    </table> 
    <div id="submenu"><br>信息管理</div> 
    <div id="submenu1" style="display:none"><a href='263.com'>好样的 </a></div> 
    <script language="javascript"> 
    function best(value){ 
    switch(value){ 
    case "test": 
    submenu.style.display = '';
    submenu1.style.display = 'none';
    break; 
    case "test1": 
    submenu.style.display = 'none';
    submenu1.style.display = '';
    break; 


    </script> </body> 
    </html>
      

  6.   

    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <title>无标题文档 </title> 
    <style type="text/css"> 
    <!-- 
    body,td,th { 
    font-family: 宋体; 

    --> 
    </style> </head> 
    <style> 
    #submenu{ 
    width:300px; 
    height:290px; 

    </style> 
    <body> <table width="200" border="1"> 
      <tr> 
        <td> <a href="#" onClick="best('test')">产品参数 </a> </td> 
        <td> <a href="#" onClick="best('test1')">运行环境 </a> </td> 
    </tr> 
    </table> 
    <div id="submenu"> <br>信息管理 </div> 
    <div id="submenu1" style="display:none"> <a href='263.com'>好样的 </a> </div> 
    <script language="javascript"> 
    function best(value){ 
    switch(value){ 
    case "test": 
    submenu.style.display = ''; 
    submenu1.style.display = 'none'; 
    break; 
    case "test1": 
    submenu.style.display = 'none'; 
    submenu1.style.display = ''; 
    break; 


    </script> </body> 
    </html>
      

  7.   

    谢谢,你们的代码实现了我的目的,不过还需将代码捎改动哈就是<tr> 
        <td> <a href="#" onClick="best('test')">产品参数 </a> </td> 
        <td> <a href="#" onClick="best('test1')">运行环境 </a> </td> 
    </tr>
    在<td>里我增加了背景,默认情况下背景是jb1.jpg,当我点第一个<td>时,背景变成了jb.jpg
    点第二个<td>时,第一个<td>背景又变成了jb1.jpg,还是和http://www.tcl.com/main/product/productinfo.jsp?catalogId=14071&productId=4449一样
    这是我改动的代码在tr前面加了form<form name=form1>
    <tr>
    <td background="images/jb1.jpg"  onmousedown="good()" name="pe"><a href="#" onClick="best('test')">产品功能</a></td>
    <td background="images/jb1.jpg" onmousedown="good1()" name="we"><a href="#" onClick="best('test1')">产品参数</a></td>
     </tr>
    </form>
    脚本增加了两个函数 good1 和good
    function good(){
    document.form1.pe.background="images/jb.jpg";
    document.form1.we.background="images/jb1.jpg";
    }
    function good1(){
    form1.pe.background="images/jb1.jpg";
    form1.we.background="images/jb.jpg";
    }
    代码错误,麻烦高手改动哈,谢谢了