首页 \ 问答 \ JQuery Mobile Slider被视为滑动事件(JQuery Mobile Slider is being viewed as a Swipe Event)

JQuery Mobile Slider被视为滑动事件(JQuery Mobile Slider is being viewed as a Swipe Event)

我正在使用滑块在JQuery Mobile中构建一个评估工具。 我将所有内容都放在一个文件中,每个页面都有多个div。 我有一个允许左右滑动的脚本。 由于脚本在用户滑动与使用滑块时无法区分,因此在调整滑块时会翻转到下一页。

我希望用户能够滑动到下一页,但不能在他们调整滑块时。 有什么建议么?? 这是滑动事件:

<script type="text/javascript">
        $('div.ui-page').live("swipeleft", function(){
            var nextpage = $(this).next('div[data-role="page"]');
            if (nextpage.length > 0) {
            $.mobile.changePage(nextpage, {transition: "slide"}, false, true);
            }
        });

        $('div.ui-page').live("swiperight", function(){
            var prevpage = $(this).prev('div[data-role="page"]');
            if (prevpage.length > 0) {
            $.mobile.changePage(prevpage, {transition: "slide",
            reverse: true}, true, true);
            }
        });
</script>

这是滑块和页面:

<div data-role="page">
        <h2>I can react quickly</h2>
        <input type="range" name="strength" id="strength" data-highlight="true" min="0" max="10" value="0">
</div>

我真的很感激任何帮助或建议!


I'm building an assessment tool in JQuery Mobile that uses sliders. I have everything in one file with multiple div's to separate each page. I have a script that allows for swipe left and right. Because the script doesn't differentiate when the user is swiping versus using the slider, it flips to the next page as they adjust the slider.

I want the user to be able to swipe to the next page, but not when they're adjusting the slider. Any suggestions?? Here is the swipe event:

<script type="text/javascript">
        $('div.ui-page').live("swipeleft", function(){
            var nextpage = $(this).next('div[data-role="page"]');
            if (nextpage.length > 0) {
            $.mobile.changePage(nextpage, {transition: "slide"}, false, true);
            }
        });

        $('div.ui-page').live("swiperight", function(){
            var prevpage = $(this).prev('div[data-role="page"]');
            if (prevpage.length > 0) {
            $.mobile.changePage(prevpage, {transition: "slide",
            reverse: true}, true, true);
            }
        });
</script>

Here is the slider and page:

<div data-role="page">
        <h2>I can react quickly</h2>
        <input type="range" name="strength" id="strength" data-highlight="true" min="0" max="10" value="0">
</div>

I'd really appreciate any help or suggestions!!


原文:https://stackoverflow.com/questions/15578795
更新时间:2022-03-16 06:03

最满意答案

是的,这可能是一个棘手的问题追查。 我一直努力,直到我找到这个线程。

http://www.khronos.org/message_boards/showthread.php/6184-Creating-buffers

当然,讨论使用这个标志的文档可以在这里找到

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateBuffer.html


yes this can be a tough issue to track down. I struggled with this for a while until I found this thread.

http://www.khronos.org/message_boards/showthread.php/6184-Creating-buffers

and ofcourse the docs discussing the use of this flag can be foudn here

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateBuffer.html

相关问答

更多
  • 我看了下好像最新的官方资料是2008年,而且API出布的时间是2007年的,因为java3d是冷门,资料全是英文的,学起来要花很长的时间去研究,如果说是已经淘汰了或有替代的话就去学更新的了
  • JAVA其实有个3d开发的框架 叫做Jmonkey 你可以去官网下个demo来看看 但貌似文档不是很多 说白了也只是些简单的api 目前的主流开发技术 应该D3D的比较多 主要是用c++
  • 以下是我转载的 CANVAS3D NULL GRAPHICS CONFGUATION错误的解决方法 JAVA3D 1.4以前的版本 没有把这个作为错误! 但是JAVA3D1.5升级了以后! 却发现在编译的时候总是出现这个错误: Exception in thread "main" java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration at javax.media.j3d.Canvas3D.checkForValidGraph ...
  • JAVA其实有个3d开发的框架 叫做Jmonkey 你可以去官网下个demo来看看 但貌似文档不是很多 说白了也只是些简单的api 目前的主流开发技术 应该D3D的比较多 主要是用c++
  • Java 3D小程序示例仍然使用'org.jdesktop.applet.util.JNLPAppletLauncher'。 由于JRE-Version 1.6.0_21-b07,此发射器无法正常工作,因此不再维护。 在'The Java Tutorial:使用Applet标签进行部署'之后'hdt://download-llnw.oracle.com/javase/tutorial/deployment/applet/html.html我切换到了applet-tag和一个相应的jnlp文件在我的网页上。 ...
  • Java applet具有生命周期方法。 那些是init , start , stop和destroy 。 您应该学会使用它们,但更重要的是,您应该在浏览器调用每种方法时学习。 当您离开页面时,会调用stop,如果您分配了任何内容,则应该停止在start和cleanup资源中start线程。 浏览器不会在每次重新加载页面时终止JVM,因为它会非常低效(并且由于其他原因),所以如果你想停止applet正在做的任何事情,请在stop方法中实现它。 另请参阅此处和该页面上的其他链接,以获取进一步说明。 Java ...
  • 看到这个,它现在停止了吗? import java.lang.Runnable; import javax.swing.SwingUtilities; import javax.swing.JFrame; public class Window1 extends JFrame { public static void main(String... args){ javax.swing.SwingUtilities.invokeLater(new java.lang.Runnabl ...
  • 是的,这可能是一个棘手的问题追查。 我一直努力,直到我找到这个线程。 http://www.khronos.org/message_boards/showthread.php/6184-Creating-buffers 当然,讨论使用这个标志的文档可以在这里找到 http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateBuffer.html yes this can be a tough issue to track down. I ...
  • 我想出如何做到这一点的最好方法是使用我在初始问题中建议的2分支组方法。 您可以创建2个分支组,一个用于选定节点,另一个用于未选定节点。 将节点从一个组移动到另一个组时,必须转换各个节点,使它们保持在当前位置,而不是跳转到它们正在加入的新分支组的转换。 The best way I figured out how to do this was to use the 2 Branch Group method I suggested in the initial question. You create 2 B ...
  • 您必须将轻量级JPopup更改为重量级,而不必发布其他内容而不发布您的SSCCE You have to change lightweight JPopup to heavyweight hard to talk something else without posting your SSCCE

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)