1/* 2 Standards Compliant Rollover Script 3 Author : Daniel Nolan 4 http://www.bleedingego.co.uk/webdev.php 5*/ 6 7function initRollovers() { 8 if (!document.getElementById) return 9 10 var aPreLoad = new Array(); 11 var sTempSrc; 12 var aImages = document.getElementsByTagName('img'); 13 14 for (var i = 0; i < aImages.length; i++) { 15 if (aImages[i].className == 'imgover') { 16 var src = aImages[i].getAttribute('src'); 17 var ftype = src.substring(src.lastIndexOf('.'), src.length); 18 var hsrc = src.replace(ftype, '_on'+ftype); 19 20 aImages[i].setAttribute('hsrc', hsrc); 21 22 aPreLoad[i] = new Image(); 23 aPreLoad[i].src = hsrc; 24 25 aImages[i].onmouseover = function() { 26 sTempSrc = this.getAttribute('src'); 27 this.setAttribute('src', this.getAttribute('hsrc')); 28 } 29 30 aImages[i].onmouseout = function() { 31 if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype); 32 this.setAttribute('src', sTempSrc); 33 } 34 } 35 } 36} 37 38window.onload = initRollovers;
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.