【发布时间】:2014-02-04 14:32:02
【问题描述】:
我有一个链接的下拉列表,我在页面加载时将其转换为选择框。这在台式机/笔记本电脑上正常工作,但在 iphone/ipad 上不起作用。
我对此完全陌生,所以我不知道是什么导致了这个问题,因为代码似乎工作正常,并在点击事件时触发页面加载。这是代码。
jQuery(document).ready(function ($)
{
$('ul.selectdropdown').each(function(){
var select=$(document.createElement('select')).insertBefore($(this).hide());
$('>li a', this).each(function(){
var a=$(this).click(function(){
if ($(this).attr('target')==='_blank'){
window.open(this.href);
}
else{
window.location.href=this.href;
}
}),
option=$(document.createElement('option')).appendTo(select).val(this.href).html($(this).html()).click(function(){
a.click();
});
});
});
});
点击功能不应该适用于所有设备吗?
艾玛
【问题讨论】:
标签: javascript jquery iphone ipad