PageSourceSearch

https://noble-lab.jp/js/rollover.js

js noble-lab.jp collected 2026-10-09 23:11:19 UTC 1,729 bytes, 68 lines download raw bytes

1//ロールオーバー
2function cq_rollover() {
3
4	if (document.getElementsByTagName) {
5
6		//プレロード用配列
7		var preload_images = new Array();
8
9		//画像処理
10		var images = document.getElementsByTagName("img");
11		
12		for (var i=0; i < images.length; i++) {
13			if (images[i].getAttribute("src").match("-off.")) {
14				
15				//プレロード処理
16				preload_images[i] = new Image();
17				preload_images[i].src = images[i].getAttribute("src").replace("-off.", "-on."); 
18				
19				//マウスオーバー処理
20				images[i].onmouseover = function() {
21					this.setAttribute("src", this.getAttribute("src").replace("-off.", "-on."));
22				}
23				
24				//マウスアウト処理
25				images[i].onmouseout = function() {
26					this.setAttribute("src", this.getAttribute("src").replace("-on.", "-off."));
27				}
28
29			}
30		}
31
32		//input type="image" 処理
33		var images = document.getElementsByTagName("input");
34
35		for (var i=0; i < images.length; i++) {
36
37			if (images[i].type != 'image') {
38				continue
39			}
40
41			if (images[i].getAttribute("src").match("-off.")) {
42
43				//プレロード処理
44				preload_images[i] = new Image();
45				preload_images[i].src = images[i].getAttribute("src").replace("-off.", "-on."); 
46				
47				//マウスオーバー処理
48				images[i].onmouseover = function() {
49					this.setAttribute("src", this.getAttribute("src").replace("-off.", "-on."));
50				}
51				
52				//マウスアウト処理
53				images[i].onmouseout = function() {
54					this.setAttribute("src", this.getAttribute("src").replace("-on.", "-off."));
55				}
56			
57			}
58		}
59
60	}
61
62}
63
64if (window.addEventListener) {
65	window.addEventListener("load", cq_rollover, false);
66} else if (window.attachEvent) {
67	window.attachEvent("onload", cq_rollover);
68}

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.