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
精彩评论