Jquery - Change Background position on 1st click, reset on the 2nd.
- by Richard
Evening all! I have half a script that I need to change the CSS background position of an element when it is clicked - this works fine. However I need the CSS to reset the background position to 0 0 on the 2nd click;
Help much appreciated!
$(document).ready(function(){
$('#login-btn').click(function(){
$('#login-btn').css('backgroundPosition', '0px -39px');
}, function(){
$('$login-btn').css('backgroundPosition', '0px 0px');
});
});