开发者

a.active what deactivates an active link?

开发者 https://www.devze.com 2023-04-01 19:14 出处:网络
some examples.. #jqt .back.active { -webkit-border-image: url(img/back_button_clicked.png) 0 8 0 14; } <a href=\"#\" class=\"back\">Back</a>

some examples..

#jqt .back.active {
-webkit-border-image: url(img/back_button_clicked.png) 0 8 0 14;
}

<a href="#" class="back">Back</a>

and

#jqt ul li a.active, #jqt ul li a.button {
background-color: #676c96; 
color: #fff;
}

<ul class="individual">
<li><a href="javascript:cart('0','empty')">Cancel</a></li>
<li><a href="javascript:placeOrder()" >Place order now</a></li>
</ul>

when either of these are pushed the active state does not turn off. Any q开发者_高级运维uirks why or a way to force the deactivation?

Thx


Slightly confusing question. a:active selects the link when it's in the active state; a.active is a class, presumably added and removed by javascript. You haven't posted your JS, so it's hard to say, but it sounds like either there's a bug in there, and it's not removing the active class properly from the elements, or, in your stylesheet you meant to use :active.


How about using JQuery, just use specified classes instead of the active state. A snippet of code ive used recently should give you some idea of how it works.

    $("#tabMenu > li").click(function () {
        $("#tabMenu > li").removeClass("selected");
        $(this).addClass("selected");
    });
0

精彩评论

暂无评论...
验证码 换一张
取 消