1//===================================================================== 2// DOM Image Rollover v3 (hover) 3// 4// Demo: http://chrispoole.com/scripts/dom_image_rollover_hover 5// Script featured on: Dynamic Drive (http://www.dynamicdrive.com) 6//===================================================================== 7// copyright Chris Poole 8// http://chrispoole.com 9// This software is licensed under the MIT License 10// <http://opensource.org/licenses/mit-license.php> 11//===================================================================== 12 13function domRollover() { 14 if (navigator.userAgent.match(/Opera (\S+)/)) { 15 var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]); 16 } 17 if (!document.getElementById||operaVersion <7) return; 18 var imgarr=document.getElementsByTagName('img'); 19 var imgPreload=new Array(); 20 var imgSrc=new Array(); 21 var imgClass=new Array(); 22 for (i=0;i<imgarr.length;i++){ 23 if (imgarr[i].className.indexOf('domroll')!=-1){ 24 imgSrc[i]=imgarr[i].getAttribute('src'); 25 imgClass[i]=imgarr[i].className; 26 imgPreload[i]=new Image(); 27 if (imgClass[i].match(/domroll (\S+)/)) { 28 imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1] 29 } 30 imgarr[i].setAttribute('xsrc', imgSrc[i]); 31 imgarr[i].onmouseover=function(){ 32 this.setAttribute('src',this.className.match(/domroll (\S+)/)[1]) 33 } 34 imgarr[i].onmouseout=function(){ 35 this.setAttribute('src',this.getAttribute('xsrc')) 36 } 37 } 38 } 39} 40domRollover();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.