/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/*Making an element transparent can be accomplished using only CSS, but requires about five lines of code. With jQuery, we can achieve transparency with just one line: */ $('selector').css('opacity', 0.5); /* below is the CSS way, and it's sloppy selector { filter: alpha(opacity=50); /* internet explorer * / -khtml-opacity: 0.5; /* khtml, old safari * / -moz-opacity: 0.5; /* mozilla, netscape * / opacity: 0.5; /* fx, safari, opera * / } */