kenzhik,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(function () {
var i = 0;
$('#indexSlider').on('click', function() {
alert(i++%4+1);
})
})
</script>
</head>
<body>
<input id = "indexSlider" type="button" value="test">
</body>
</html>