PageSourceSearch

https://www.h-fureai.com/js/rollover.js

js h-fureai.com collected 2026-10-05 10:57:22 UTC 3,439 bytes, 92 lines download raw bytes

1/*====================================================================================================
2//////////////////////////////////////////////////////////////////////////////////////////////////////
3
4 Author : http://www.yomotsu.net
5 created: 2007/03/13
6 update : 2008/01/21
7 Licensed under the GNU Lesser General Public License version 2.1
8
9//////////////////////////////////////////////////////////////////////////////////////////////////////
10====================================================================================================*/
11var yomotsuRollover = {
12	
13	main : function() {
14		var img = document.images, ipt = document.getElementsByTagName('input'), ibt = document.getElementsByTagName('button'), i, preLoadImg = [];
15		// img elements
16		for (i = 0; i <img.length; i++) {
17			if ((img[i].src.match(/.*_off\./))||(img[i].style.filter)){
18				preLoadImg[preLoadImg.length] = new Image;
19				preLoadImg[preLoadImg.length-1].src = img[i].src.replace('_off.', '_on.');
20
21				img[i].onmouseover = yomotsuRollover.over;
22				img[i].onmouseout  = yomotsuRollover.out;
23				try {img[i].addEventListener('click', yomotsuRollover.click, false);}
24				catch(e){img[i].attachEvent('onclick', (function(el){return function(){yomotsuRollover.click.call(el);};})(img[i]));}
25			}
26		}
27		// input[image] elements
28		for (i = 0; i <ipt.length; i++) {
29			if ((ipt[i].src.match(/.*_off\./))&&(ipt[i].getAttribute('type')=='image')){
30				preLoadImg[preLoadImg.length] = new Image;
31				preLoadImg[preLoadImg.length-1].src = img[i].src.replace('_off.', '_on.');
32
33				ipt[i].onmouseover = yomotsuRollover.over;
34				ipt[i].onmouseout  = yomotsuRollover.out;
35				try {ipt[i].addEventListener('click', yomotsuRollover.click, false);}
36				catch(e){ipt[i].attachEvent('onclick', (function(el){return function(){yomotsuRollover.click.call(el);};})(ipt[i]));}
37			}
38		}
39		// button elements
40		for (i = 0; i <ibt.length; i++) {
41			ibt[i].onmouseover = yomotsuRollover.over2;
42			ibt[i].onmouseout  = yomotsuRollover.out2;
43			try {ibt[i].addEventListener('click', yomotsuRollover.click2, false);}
44			catch(e){ibt[i].attachEvent('onclick', (function(el){return function(){yomotsuRollover.click2.call(el);};})(ibt[i]));}
45		}
46	}
47	,
48	
49	over : function() {
50		var imgSrc, preLoadImgSrc;
51		if((this.style.filter)&&(this.style.filter.match(/_off\.png/)))//(IE5.5-6 && png)
52			this.style.filter = this.style.filter.replace('_off.png', '_on.png');
53		else
54			this.src = this.src.replace('_off.', '_on.');
55	},
56	
57	over2 : function() {
58		this.children[0].src = this.children[0].src.replace('_off.', '_on.');
59	},
60
61	out : function(){
62		if((this.style.filter)&&(this.style.filter.match(/_on\.png/)))//(IE5.5-6 && png)
63			this.style.filter = this.style.filter.replace('_on.png', '_off.png');
64		else
65			this.src = this.src.replace('_on.', '_off.');
66	},
67	
68	out2 : function(){
69		this.children[0].src = this.children[0].src.replace('_on.', '_off.');
70	},
71	
72	click : function(){
73		if((this.style.filter)&&(this.style.filter.match(/_on\.png/)))//(IE5.5-6 && png)
74			this.style.filter = this.style.filter.replace('_on.png', '_off.png');
75		else
76			this.src = this.src.replace('_on.', '_off.');
77	},
78	
79	click2 : function(){
80		this.children[0].src = this.children[0].src.replace('_on.', '_off.');
81	},
82
83	addEvent : function(){
84		try {
85			window.addEventListener('load', this.main, false);
86		} catch (e) {
87			window.attachEvent('onload', this.main);
88		}
89	}
90}
91
92yomotsuRollover.addEvent();

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.