http://blog.csdn.net/net_lover/archive/2001/01/15/6826.aspx

解决方案 »

  1.   

    显示与隐藏:
    如果在后台判断,可以
    <%
    //条件
    if(xxx==true)
    {
    %>
    <table align=center width="800"  border="0" cellspacing="0" cellpadding="0" style="border-Left: 0;border-Bottom:0.0cm ">
      <tr>
       <td  width="100%" height="25" background="<%=channelBGImage%>" align="center">
       [账号:管理员]
       </td>
      </tr>
    </table>
    <%
    }
    %>
      

  2.   

    也可以使用ajax,xmlhttp来进行js实现显示与隐藏
    xxID.style.display="none"
    xxID.style.display=""
      

  3.   

    楼上的,我隐藏只是隐藏标签,table及账号不用隐藏。
    谢谢:)
      

  4.   

    闪烁标签没有,写段脚本楼主参考一下:<html>
    <script>
    var flickColor = "#FF0000|#FFFF00|#3366FF" ;
    var deFaultColor = "#000000" ;
    var flickSpeed = 100 ;
    function flick( the , flickColor , deFaultColor , flickSpeed )
    {
    var _index = 0 ;
    var flickArray = flickColor.split( "|" ) ;
    var ID = setInterval( _flick , flickSpeed )
    the.setAttribute( "flickID" , ID ) ;
    the.setAttribute( "deFaultColor" , deFaultColor ) ;
    function _flick()
    {
    the.style.color = flickArray[ _index++ % flickArray.length ] ;
    }
    }
    function stopFlick( the )
    {
    var ID = the.getAttribute( "flickID" ) ;
    var c = the.getAttribute( "deFaultColor" ) ;
    clearInterval( ID ) ;
    the.style.color = c ;
    }
    function div_click( the )
    {
    if( the.getAttribute( "flag" ) == null )
    {
    the.setAttribute( "flag" , true ) ;
    }
    if( the.getAttribute( "flag" ) )
    {
    flick( the , flickColor , deFaultColor , flickSpeed ) ;
    the.innerHTML = "点我结束" ;
    the.setAttribute( "flag" , false ) ;
    }
    else
    {
    stopFlick( the ) ;
    the.innerHTML = "点我开始" ;
    the.setAttribute( "flag" , true ) ;
    }
    }
    </script><body>
    <div onclick="div_click( this )">点我开始</div>
    </body>
    </html>
      

  5.   

    //楼主在JSP中判断是否要显示与闪烁。
    <script language="javascript" type="text/javascript">
    function checkit()
    {
    self.setInterval("changeit()",1000);
    }
    function changeit()
    {

    var colors = new Array('#FF9900','#3366FF','#33FF00','#FF00FF');
    var sign = Math.ceil(Math.random()*10)%3;
    var news = document.getElementById("news");
    news.style.color = colors[sign];
    }
    </script>
    </HEAD><BODY onload="checkit('news');return true;">
    <button onclick="window.clearInterval();">aSDasd</button>
    <table align=center width="800" border="1" cellspacing="0" cellpadding="0" style="border-Left: 0;border-Bottom:0.0cm ">
    <tr>
    <td width="100%" height="25" background="<%=channelBGImage%>" align="center">[账号:管理员]<span id="news" style="">你有新短消息,请注意查收!!</span></td>
    </tr>
    </table>
    </BODY>
    </HTML>
      

  6.   

    <script language="javascript" type="text/javascript">
    function checkit()
    {
    window._x=self.setInterval("changeit()",1000);
    }
    function changeit()
    {

    var colors = new Array('#FF9900','#3366FF','#33FF00','#FF00FF');
    var sign = Math.ceil(Math.random()*10)%3;
    var news = document.getElementById("news");
    news.style.color = colors[sign];
    }
    </script>
    </HEAD><BODY onload="checkit('news');return true;">
    <button onclick="window.clearInterval();">aSDasd</button>
    <table align=center width="800" border="1" cellspacing="0" cellpadding="0" style="border-Left: 0;border-Bottom:0.0cm ">
    <tr>
    <td width="100%" height="25" background="<%=channelBGImage%>" align="center">[账号:管理员]<span id="news" style="" onclick="window.clearInterval(_x);this.style.color='#000'">你有新短消息,请注意查收!!</span></td>
    </tr>
    </table>
    </BODY>
    </HTML>
      

  7.   

    <script language="javascript" type="text/javascript">
    function checkit()
    {
    window._x=self.setInterval("changeit()",1000);
    }
    function changeit()
    {

    var colors = new Array('#FF9900','#3366FF','#33FF00','#FF00FF');
    var sign = Math.ceil(Math.random()*10)%3;
    var news = document.getElementById("news");
    news.style.color = colors[sign];
    }
    </script>
    </HEAD><BODY onload="checkit('news');return true;">
    <button onclick="window.clearInterval();">aSDasd</button>
    <table align=center width="800" border="1" cellspacing="0" cellpadding="0" style="border-Left: 0;border-Bottom:0.0cm ">
    <tr>
    <td width="100%" height="25" background="<%=channelBGImage%>" align="center">[账号:管理员]<span id="news" style="" onclick="window.clearInterval(_x);this.style.display='none'">你有新短消息,请注意查收!!</span></td>
    </tr>
    </table>
    </BODY>
    </HTML>
      

  8.   

    非常感谢谢大家。感谢BlueDestiny(这回真的准备要改名字了...) ,lantersen(蓝水仁),xishanlang2001(西山狼2000) ,net_lover(【孟子E章】) (