链接为jsfiddle:http://jsfiddle.net/6UWZQ/1
看看这个实时链接,如果你点击删除或编辑的任何一行,点击取消后,该按钮将保持高亮显示(仅限Firefox)
我按下这样的按钮:
$("input[type=submit]").addClass("abtn"); 
$("tbody a").addClass("abtn");
$(".abtn").button();
我在提交按钮上使用css类为每个表单添加一个确认对话框,如下所示:
<script type="text/javascript">
        var currentFormconfirm;
        $(function () {
            $("#dialog-confirm-confirm").dialog({
            show: "drop",
            hide: "fade",
                resizable: false,
                height: 220,
                width: 400,
                modal: true,
                autoOpen: false,
                buttons: {
                    'Yes': function () {
                        $(this).dialog('close');
                        currentFormconfirm.submit();
                    },
                    'Cancel': function () {
                        $(this).dialog('close');
                    }
                }
            });
            $(".confirm").click(function () {
                currentFormconfirm = $(this).closest('form');
                $("#dialog-confirm-confirm").dialog('open');
                return false;
            });
        });
</script>
<div id="dialog-confirm-confirm" title="Confirm dialog">
    Are you sure you want to delete this foobar ?
</div>
和形式:
<form action="/awesome/foobar/Delete/7" method="post" class="fr">
                    <input type="submit" class="confirm abtn ui-button ui-widget ui-state-default ui-corner-all" value="Delete" role="button" aria-disabled="false">
                    </form>
小智 7
也有点晚了,但......
结合上面的建议,我能够通过将其包含在$(document).ready中来解决页面上所有按钮的问题
$("button, input[type='button'], input[type='submit']").button()
    .bind('mouseup', function() {
        $(this).blur();     // prevent jquery ui button from remaining in the active state
});
| 归档时间: | 
 | 
| 查看次数: | 7436 次 | 
| 最近记录: |