开发者

Change Background position onClick

I would like to change t开发者_StackOverflowhe background position of one link when another link is clicked. I want this to change:

<a class="fast btn-slide" href="#"></a>


Add an onclick event handler to the link and change/add a predefined class to the link


<style type="text/css">
.ThirdClassName { position:absolute;left:25px;top:25px; }
</style>

<a class="fast btn-slide" href="#" onclick="this.className += ' ThirdClassName'"></a>

This adds a class behind the others that are currently defined

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜