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
最满意答案
是的,这可能是一个棘手的问题追查。 我一直努力,直到我找到这个线程。
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
相关问答
更多-
Java3D是否已经淘汰 Java SE[2022-08-14]
我看了下好像最新的官方资料是2008年,而且API出布的时间是2007年的,因为java3d是冷门,资料全是英文的,学起来要花很长的时间去研究,如果说是已经淘汰了或有替代的话就去学更新的了 -
关于Java3D开发的前途[2022-04-19]
JAVA其实有个3d开发的框架 叫做Jmonkey 你可以去官网下个demo来看看 但貌似文档不是很多 说白了也只是些简单的api 目前的主流开发技术 应该D3D的比较多 主要是用c++ -
java 中的 java3d 环境配置?[2022-02-08]
以下是我转载的 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 ... -
关于Java3D开发的前途[2022-04-21]
JAVA其实有个3d开发的框架 叫做Jmonkey 你可以去官网下个demo来看看 但貌似文档不是很多 说白了也只是些简单的api 目前的主流开发技术 应该D3D的比较多 主要是用c++ -
使用JNLP启动Java3D依赖关系的applet时出现问题(Problem using JNLP to launch applet with Java3D dependencies)[2024-01-06]
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 ...
-
Java3d applet中的JPopupMenu不接收鼠标或键盘输入(JPopupMenu in Java3d applet does not receive mouse or keyboard input)[2022-04-30]
您必须将轻量级JPopup更改为重量级,而不必发布其他内容而不发布您的SSCCE You have to change lightweight JPopup to heavyweight hard to talk something else without posting your SSCCE