在 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/