querySelectorAll不会在iPad上触发

时间:2017-05-02 10:02:42

标签: javascript jquery

我有一个激活' showBorder'选择尺寸时在台式机和iPhone上工作正常,但在iPad上无法启动。有人熟悉这个问题吗?它看起来很奇怪iphone但ipad。请看下面我的所有剧本:



function applyRecommendedSleeveLength(selectedVal) {
if(selectedVal !== undefined){
var recommendedVal = map[selectedVal.trim()];
        var sleevSwatches = document.querySelectorAll('[class*="attribute__swatch--length-"] div');
        sleevSwatches.forEach(function(swatch, i) {         
        swatch.classList.remove('showBorder');
        });
        var recommendedLi = document.querySelector('[class*="attribute__swatch--length-'+recommendedVal+'"] div');
        recommendedLi.classList.add('showBorder');
        
}
}




0 个答案:

没有答案