source: branches/version-2_11-dev/html/user_data/packages/sphone/js/btn.js @ 21059

Revision 21059, 688 bytes checked in by 468, 13 years ago (diff)

#1413 スマートフォン版Javascript(JQuery、JQueryMobile、JQueryLightBox、JQueryFlickslideライブラリ含む)ファイル追加

  • Property svn:mime-type set to text/plain
Line 
1
2       
3        function smartRollover() {
4    if(document.getElementsByTagName) {
5        var images = document.getElementsByTagName("img");
6
7        for(var i=0; i < images.length; i++) {
8            if(images[i].getAttribute("src").match("_off."))
9            {
10                images[i].onmouseover = function() {
11                    this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
12                }
13                images[i].onmouseout = function() {
14                    this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
15                }
16            }
17        }
18    }
19}
20
21if(window.addEventListener) {
22    window.addEventListener("load", smartRollover, false);
23}
24else if(window.attachEvent) {
25    window.attachEvent("onload", smartRollover);
26}
27
Note: See TracBrowser for help on using the repository browser.