Ignore:
Timestamp:
2013/08/20 21:31:31 (11 years ago)
Author:
pineray
Message:

#2347 JavaScript?文法チェック
eccube.sphone.js を対応.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/html/user_data/packages/sphone/js/eccube.sphone.js

    r23078 r23107  
    3232    eccube.smartRollover = function() { 
    3333        if (document.getElementsByTagName) { 
    34             var images = document.getElementsByTagName("img"); 
     34            var images = $("img"); 
     35            var re = /_off¥./; 
    3536 
    36             for (var i=0; i < images.length; i++) { 
    37                 if (images[i].getAttribute("src").match("_off.")) { 
    38                     images[i].onmouseover = function() { 
     37            images.each(function(){ 
     38                var target = $(this); 
     39                if (target.attr("src").match(re)) { 
     40                    target.on("vmouseover", function(){ 
    3941                        this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on.")); 
    40                     }; 
    41                     images[i].onmouseout = function() { 
     42                    }); 
     43                    target.on("vmouseout", function(){ 
    4244                        this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off.")); 
    43                     }; 
     45                    }); 
    4446                } 
    45             } 
     47            }); 
    4648        } 
    4749    }; 
     
    7375            cache: false, 
    7476            dataType: "text", 
    75             error: function(XMLHttpRequest, textStatus, errorThrown){ 
    76                 alert(textStatus); 
     77            error: function(XMLHttpRequest, textStatus){ 
     78                window.alert(textStatus); 
    7779                $.mobile.hidePageLoadingMsg(); 
    7880            }, 
    7981            success: function(result){ 
    80                 if (result == "true") { 
    81                     alert("お気に入りに登録しました"); 
     82                if (result === "true") { 
     83                    window.alert("お気に入りに登録しました"); 
    8284                    $(".btn_favorite").html("<p>お気に入り登録済み</p>"); 
    8385                } else { 
    84                     alert("お気に入りの登録に失敗しました"); 
     86                    window.alert("お気に入りの登録に失敗しました"); 
    8587                } 
    8688                $.mobile.hidePageLoadingMsg(); 
     
    9799    $(function(){ 
    98100        //level?クラスを持つノード全てを走査し初期化 
    99         $("#categorytree li").each(function(){ 
    100             if ($(this).children("ul").length) { 
     101        $("#categorytree").find("li").each(function(){ 
     102            if ($(this).find("> ul").length) { 
    101103                //▶を表示し、リストオープンイベントを追加 
    102                 var tgt = $(this).children('span.category_header'); 
     104                var tgt = $(this).find("> span.category_header"); 
    103105                var linkObj = $("<a>"); 
    104                 linkObj.text('+'); 
     106                linkObj.html('+'); 
    105107                tgt 
    106108                    .click(function(){ 
    107109                        $(this).siblings("ul").toggle('fast', function(){ 
    108110                            if ($(this).css('display') === 'none') { 
    109                                 tgt.children('a').text('+'); 
     111                                tgt.children('a').html('+'); 
    110112                            } else { 
    111                                 tgt.children('a').text('-'); 
     113                                tgt.children('a').html('-'); 
    112114                            } 
    113115                        }); 
Note: See TracChangeset for help on using the changeset viewer.