手機的長按事件,鬆開
$(".gamePlay").on('mousedown touchstart',function(){}
$(".gamePlay").on('mouseup touchend',function(){}
手機長按的時候,移動手指,上面的點擊事件中斷
解決方法:event.preventDefault();
手機的左右滾動iscoller
hScrollbar:false水平滾動條是否隱藏
vScrollbar:false垂直滾動條是否隱藏
hScroll * |
是否允許水平滾動 | false 否 true 是 |
true |
vScroll * |
是否允許垂直滾動 | false 否 true 是 |
true |
var scroll=new iScroll("picContainer",{hScrollbar:false, vScrollbar:false,vScroll:false});
判斷是手機還是電腦
if ($("body").width() < $("body").height()) //當寬小於高的時候證明是手機
寬和高旋轉90deg
var _translate = _translate = ($(window).height() - $(window).width()) / 2 + "px";
$(".content").css({
"width": $(window).height() + "px",
"height": $(window).width() + "px",
"-webkit-transform": "rotate(90deg) translate(" + _translate + "," + _translate + ")",
"-moz-transform": "rotate(90deg) translate(" + _translate + "," + _translate + ")",
"transform": "rotate(90deg) translate(" + _translate + "," + _translate + ")"
});
-webkit-animation當加了動畫屬性的時候,這個屬性的東西會在最頂層,那麼z-index失效,加一個空的-webkit-animation即可,但是@keyframes 不可以真的爲空,要有屬性的設置纔可以