zoukankan      html  css  js  c++  java
  • 使用JavaScript动态设置样式 Ver2

    你可以参考到前一版本http://www.cnblogs.com/insus/archive/2011/08/18/2143996.html 这个有点不好的地方,就是如果想改变样式,也许得使用查找替换才行。

    因此,Insus.NET写出另外一个方法来实现,这样可以改一应用百。

    先写一个样式Style:

     <style type="text/css">
        .overStyle 
        
    {
           border-color
    :#3599ff;
        
    }
        .outStyle 
        
    {
            border-color
    : #fff;
        
    }
    </style>

    Javascript也要改一下:

     <script type="text/javascript">

            
    function onOver(Id) {
                Id.className 
    = 'overStyle';
            }

            
    function onOut(Id) {
                Id.className 
    = 'outStyle';
            }
        
    </script>

    最后是html的动态应用。

     <fieldset id="fs1" style="margin: 10px; padding: 10px;  170px; text-align: center;"
                        onmouseover
    ="onOver(this)" onmouseout="onOut(this)">
                        ERP 
    <href="http://xxx.xxx.com/erp" target="_blank">http://xxx.xxx.com/erp </a>
                    
    </fieldset>
  • 相关阅读:
    python file op
    python write read
    Linux MD RAID 10
    bitmap.h
    1
    write 1 to block device
    tr '00' '377' < /dev/zero | dd of=/dev/$i bs=1024 count=1024000
    Superblock
    echo -e "33[41;36m something here 33[0m"
    May It Be
  • 原文地址:https://www.cnblogs.com/insus/p/2144041.html
Copyright © 2011-2022 走看看