jquery-mobile - jQuery Mobile 从提交按钮指定页面动画

标签 jquery-mobile

在 jQuery mobile 中创建表单时,似乎默认表单功能是从 <form> 指定页面加载动画。标签而不是提交按钮。我正在尝试构建一个带有两个提交按钮的表单,每个按钮都应该执行不同的动画(这听起来很奇怪,但在应用程序的上下文中是有道理的。但这不是问题的重点:))

有没有办法绕过 <form> 中的默认规范?在 <input> 中标记并指定动画代替每个提交按钮的标签?所以这就是我要做的:

//this is where I have to specify the animation now, but I only want one button
//to trigger a "pop" animation
<form action='blah.php' data-transition='pop'>
    //form elements and whatnot

    //I'd like this button to have one animation by specifying it here:
    <input type='submit' value='submit button 1' data-transition='slide'>

    //And this button to have a different animation by specifying it here:
    <input type='submit' value='submit button 2' data-transition='pop'>

现在,在 <input> 中指定的转换无论我是否在 <form> 中指定转换,标签都会被忽略

有谁知道我怎样才能让它发挥作用?

最佳答案

可能是我错了,我认为提交按钮不支持转换,但 anchor 标记支持.. 使用 anchor 标记试试这个...

例如,

<form action="blah.php" method="get">
<a id="direct1" data-transition="slide">submit button 2</a>
<a id="direct2" data-transition="pop">submit button 2</a>
</form>

如果此代码确实运行,请尝试添加 data-ajax="false"在 anchor ....

关于jquery-mobile - jQuery Mobile 从提交按钮指定页面动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10238902/

相关文章:

javascript - 在 jQuery Mobile 中以响应方式显示或隐藏按钮文本

ipad - jQuery Mobile 响应式面板和 Textarea

javascript - 检查返回 true 失败

jquery - 如何以一种易于访问的方式隐藏 jQuery Mobile 表单中的标签标记?

jquery - 调整浏览器大小时如何防止我的 div 重叠?

javascript - jquery mobile 移动返回过渡?

javascript - Jasmine 与 jQuery Mobile 的兼容性

c# - ASP.NET MVC3 jQuery 移动页面的 Ajax 代码绑定(bind)使用 PageInit 事件

javascript - $.mobile.loading 拒绝工作

jquery mobile 阻止提交