PageSourceSearch

https://nihonkaisui.co.jp/js/rollover.js

js nihonkaisui.co.jp collected 2026-10-04 21:51:42 UTC 1,428 bytes, 54 lines download raw bytes

1function initRollovers() {
2	if (!document.getElementById) return
3	
4	var aPreLoad = new Array();
5	var sTempSrc;
6	var aImages = document.getElementsByClassName("rollover");
7
8
9	for (var i = 0; i < aImages.length; i++) {
10		if (aImages[i].getElementsByTagName('img')) {
11			var src = aImages[i].getAttribute('src');
12			var ftype = src.substring(src.lastIndexOf('.'), src.length);
13			var hsrc = src.replace(ftype, '_o'+ftype);
14
15			aImages[i].setAttribute('hsrc', hsrc);
16			
17			aPreLoad[i] = new Image();
18			aPreLoad[i].src = hsrc;
19			
20			aImages[i].onmouseover = function() {
21				sTempSrc = this.getAttribute('src');
22				this.setAttribute('src', this.getAttribute('hsrc'));
23			}	
24			
25			aImages[i].onmouseout = function() {
26				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('-on'+ftype, ftype);
27				this.setAttribute('src', sTempSrc);
28			}
29		}
30	}
31}
32
33document.getElementsByClassName = function(classname) {
34	var elements = new Array();
35	var re = new RegExp('(^| )'+classname+'( |$)');
36	var ael = document.getElementsByTagName('*');
37	var op = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
38	if (document.all && !op) ael = document.all;
39		for(i=0, j=0 ; i<ael.length ; i++) {
40			if(re.test(ael[i].className)) {
41				elements[j]=ael[i];
42				j++;
43			}
44		}
45	return elements;
46};
47
48//$(document).ready(function(){
49(function($){
50
51	initRollovers();
52})(jQuery);
53
54//});

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.