在jQuery手机中创建表单时,似乎缺省表单功能是从<form>
标记中指定页面加载动画,而不是提交按钮。我试图用两个提交按钮构建一个表单,每个按钮都应该执行不同的动画(听起来很奇怪,但它在应用程序的上下文中是有意义的,但这不是问题的要点:))jQuery Mobile从提交按钮指定页面动画
有没有一种方法可以解决<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>
过渡有谁知道我怎么能得到这个上班?
我可能是错的,但是在这种情况下,操作页面'blah.php'需要以某种方式将'data-rel ='对话框的属性加入到表单提交中。我相信(而且,我可能会错),获得效果的唯一方法是妨碍jQuery移动UI将其检测为对话框。如果你有一个jsfiddle演示或者我可能会有更多的帮助。 – adamdehaven 2012-04-20 15:40:24
不幸的是,我似乎不能创建一个小提琴来演示这一点。转换仅适用于同域链接。我试着尝试使用他们提供的AJAX示例,但是如果没有发布到页面,它似乎不会返回任何内容。 但我不认为'data-rel'缺少问题。当我在'