Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-05-16 15:57:551580browse

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.

Statement:
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