隐藏和显示功能在Safari中不起作用 [英] Hide and show function not working in Safari

查看:361
本文介绍了隐藏和显示功能在Safari中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此功能应停止显示 #bt_pagamento 并开始显示 #bt_loading 。但 Safari(版本6)是此功能无法使用的唯一浏览器。在早期版本的 Safari 版本5.1.9 Mac 5.1.7 Win )中,它运行良好。

This function should stop displaying the #bt_pagamento and start showing the #bt_loading. But Safari (version 6) is the only browser that this function doesn't work. In early versions of Safari (version 5.1.9 Mac and 5.1.7 Win) it worked perfectly.

$("#bt_pagamento").click(function () {
$(this).css({'display':'none'});
$("#bt_loading").show();
});

有没有人知道解决这个问题?

Does anyone know a work around for this?

推荐答案

CSS

<style>
.hide { display: none; }
</style>

HTML

<a href="#" id="bt_pagamento">link</a>
<div id="bt_loading" class="hide">
    this is bt_loading
</div>

JS

$(document).ready(function() {
    $("#bt_pagamento").click(function (e) {
        e.preventDefault();
        $(this).addClass('hide');
        $("#bt_loading").removeClass('hide');
    });
});

这篇关于隐藏和显示功能在Safari中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆