简体   繁体   中英

jquery mobile button doesn't come up

I'm using jquery mobile 1.3.2, and whenever I press the button, the button shows the style of being pressed, but then it never come back up again.

HTML:

<form id="login_form">
<input type="text" name="username">
<input type="password" name="password">
<button type="submit" data-theme="b" data-role="submit">Login</button>
</form>

Javascript:

$("#login_form").submit(function()
{
    $.mobile.allowCrossDomainPages = true;
    var options = {
        url:API_SERVER_URL+"/login",
        type: "post",
        success: function(data)
        {
            if (data.success)
            {

                $.mobile.changePage('success.html', {transition: "slide"});
            }else
            {
                alert("failed:("); 
            }
        },
        error: function()
        {
            alert('cannot connect');
        }
    };
    options = $.extend(DEFAULT_AJAX_OPTIONS, options);
    $(this).ajaxSubmit(options);
    return false;
});

按下后的外观

Remove ui-btn-active when form is submitted.

$("#login_form").on("submit", function () {
  $("[type=submit]").closest('div').removeClass("ui-btn-active");
});

Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM