2012-06-15 2 views
0

iPhone 전용 아코디언을 만드는 더 좋은 방법이 있습니까?iPhone 용 jQuery 아코디언

$(document).ready(function() { 
var device = navigator.userAgent.toLowerCase(); 
var ios = device.match(/(iphone|ipod|ipad)/); 
if (ios) { 
    $("#Main_Box_Section .box2:not(:first)").hide(); 
    $("#Main_Box_Section h3").click(function() { 
     $(this).next(".box2").slideToggle("slow").siblings(".box2:visible").slideUp("slow") 
    }) 
} 
}); 

답변

1

Zepto.js에서 촬영 :

var ua = navigator.userAgent.toLowerCase(); 

var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); 
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); 

if(iphone){ 
    ... 
}