Home > Article > Web Front-end > js method to add transparency to div by moving the mouse over it_javascript skills
The example in this article describes the js method of adding transparency to a div by moving the mouse over it. Share it with everyone for your reference. The specific implementation method is as follows:
<script language="javascript"> <!-- Begin if ((navigator.appName.indexOf('Microsoft')+1)) { document.write('<style type="text/css"> #div2 a img{ filter:alpha(opacity=100)} #div2 a:hover img{ filter:alpha(opacity=70)} </style>');} if ((navigator.appName.indexOf('Netscape')+1)) { document.write('<style type="text/css"> #div2 a img{opacity: 1;} #div2 a:hover img{opacity: 0.7;}</style>'); } else { document.write(''); } // End --> </script>
I hope this article will be helpful to everyone’s JavaScript programming design.