, jQuery, URL-, :
var images = ['../images/####','../images/$$$$', 'http://some.other/url.here];
// do this for as many images as you want to cycle through
.
:
var counter = 0;
.
on() div :
$('#knapp').on('click', function(){
});
, CSS background-image div :
$('#knapp').on('click', function(){
$(this).css('background-image','url("' + images[counter] + '")');
counter++;
});
, ! , counter
------------------------------------------- ---------------------
, - , , - . , on():
if(counter >= images.length - 1){
counter = 0;
}
2 ------------------------------------------ --------------------
, , , . , , , - :
$(document).ready(function(){
$('#knapp').on('click', function(){
$(this).css('background-image','url("YOUR_NEW_URL_HERE")');
});
});
, CSS ( ) .addClass .removeClass.
3 ------------------------------------------ ---------------------
, , , , , body ( ). ( - ).