Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Javascript调用JQuery移动转换_Javascript_Jquery_Mobile_Transition_Swipe - Fatal编程技术网

使用Javascript调用JQuery移动转换

使用Javascript调用JQuery移动转换,javascript,jquery,mobile,transition,swipe,Javascript,Jquery,Mobile,Transition,Swipe,我正在使用Hammer.js添加一个滑动手势来滑动我的网站页面 现在我想使用jquerymobile添加一个转换,但是转换是在HTML中调用的。是否可以调用动画: data-transition="slide" 通过Javascript <script type="text/javascript"> var hammertime = Hammer('html', {swipe_max_touches: 2, prevent_mouseevents: true }).on("swip

我正在使用Hammer.js添加一个滑动手势来滑动我的网站页面

现在我想使用jquerymobile添加一个转换,但是转换是在HTML中调用的。是否可以调用动画:

data-transition="slide"
通过Javascript

<script type="text/javascript">
var hammertime = Hammer('html', {swipe_max_touches: 2, prevent_mouseevents: true
}).on("swiperight", function(event) {
document.location = "http://example.com";
});

var hammertime=Hammer('html',{swipe\u max\u touch:2,prevent\u mouseevents:true
}).on(“swiperight”,功能(事件){
document.location=”http://example.com";
});
您可以使用

$.mobile.changePage( url, { transition: "slideup" });

为了缩短加载时间,您可以使用


您可以使用

$.mobile.changePage( url, { transition: "slideup" });

为了缩短加载时间,您可以使用


$.mobile.changePage()
现在不推荐使用。正确的方法是使用:

  • $.mobile.navigate(#bar),{转换:“幻灯片”,信息:“关于#bar散列的信息”})
  • $.mobile.pageContainer.pageContainer(“更改”、“目标”{transition:“流”,changeHash:false,reload:true})
  • 我想我会从其他线索中学到的知识来回答这个问题。 我没有足够的声誉来建立其余的链接。只需在Google上搜索代码即可找到各自的StackOverflow线程。

    $。mobile.changePage()
    现在已不推荐使用。正确的方法是使用:

  • $.mobile.navigate(#bar),{转换:“幻灯片”,信息:“关于#bar散列的信息”})
  • $.mobile.pageContainer.pageContainer(“更改”、“目标”{transition:“流”,changeHash:false,reload:true})
  • 我想我会从其他线索中学到的知识来回答这个问题。
    我没有足够的声誉来建立其余的链接。只需在Google上搜索代码即可找到各自的StackOverflow线程。

    我知道JQuery Mobile的新功能“滑动导航”,但我想使用Hammer.jsI知道JQuery Mobile的新功能“滑动导航”但是我想使用Hammer.js你可以使用预取来尝试加快加载时间你可以使用预取来尝试加快加载时间稍微晚一点,但是我会在我需要它的时候再做研究,但是当我再次需要它的时候,我会再做研究