jQuery无法在IE9中隐藏选项
jQuery not working in IE9 for hiding options
对于此页面:http://rmetro.uscav.com/az/fire/duty-shirts/09820.html
它隐藏基于URL的选项。除了IE9的糟糕,你知道罪魁祸首是什么吗?
<script>
$j(window).load(function(){
var url = window.location.href;
url = url.split('/');
var word = url['3'].replace(/-/g,' ');
var select = $j('#product-options-wrapper').find('div.option label:contains("Patch Type")').parents('div.option').find('select');
var totalOption = select.find('option').length;
var count = 0;
select.find('option').each(function(i){
if($j(this).text().toLowerCase().indexOf(word) == -1){
$j(this).wrap('<span>').hide();
count++;
}
if(count === totalOption){
select.find('option').each(function(){
if($j(this).text().toLowerCase().indexOf('generic') >= 0){
if($j(this).parent().is('span')){
$j(this).unwrap().show();
}
}
});
}
if(i+1 === totalOption){
select.find('option').eq(1).unwrap().show();
}
});
if(word.indexOf('ca') == -1){
$j('#product-options-wrapper').find('div.option label:contains("San Diego Badge Type")').parents('div.option').hide();
}
});
</script>
您的页面上有一个错误:
TypeError: $j(...).cycle is not a function
也许浏览器处理它的方式不同。我建议你先解决这个问题,然后再试一次。
相关文章:
- jQuery无法在IE9中隐藏选项
- 通过单击选项卡而不是单击网站的任何部分来隐藏选项卡
- jQuery 隐藏选项元素
- Javascript变量在IE中不起作用||用Javascript隐藏选项
- JQuery隐藏选项没有'我在IE 11中不工作
- jquery动态地隐藏选项卡
- 在 IE 中隐藏选项标记
- 使用 jQuery inArray 并隐藏选项值
- 没有内容时隐藏选项卡,单击选项卡后加载内容
- 循环浏览选项,包括隐藏选项
- RadTabStrip-隐藏选项卡客户端
- 关于django模板中表单字段值的动态隐藏/取消隐藏选项卡
- 将隐藏选项卡中的HTML5验证事件传递给JavaScript函数
- Bootstrap隐藏选项卡中的选项卡按钮
- UserVoice小部件隐藏选项卡
- 使用javascript选择另一个选项后,循环隐藏选项不起作用
- DIV的显示和隐藏选项(需要修改)
- MSCRM 2011基于statcode字段值的隐藏选项卡
- 使用jquery使用文本框取消隐藏选项卡会取消隐藏错误的部分
- 试图使响应导航在每个页面中默认隐藏选项