Home > Web Front-end > JS Tutorial > js method to add transparency to div by moving the mouse over it_javascript skills

js method to add transparency to div by moving the mouse over it_javascript skills

WBOY
Release: 2016-05-16 15:57:55
Original
1651 people have browsed it

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>

Copy after login

I hope this article will be helpful to everyone’s JavaScript programming design.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template