06-06-2012, 14:33
(Ten post był ostatnio modyfikowany: 06-06-2012, 14:33 przez Kartofelek.)
Źle napisane.
Kod:
<script type="text/javascript">
var index = 1;
jQuery.fn.poka=function() {
var $t = $(this);
$t.css('background-image', 'url(images/p' + index + '.jpg)');
index++;
if (index >= 10) index = 1;
setTimeout(
function() {
$t.poka() //w setTimeout this = window
}
,3000
);
}
$(document).ready(function() {
$("#wrap").poka();
});
</script>