В SetInterval не заходит
Такая вот ситуация, не заходит в setinterval.
script type="text/javascript">
function Slider(){
var size = $('.slider div').size();
var count = 1;
setinterval(function(){
alert("#img"+ count+", #img"+ (count+1));
//$("#img"+ count).css({'dispaly' : 'none'});
//$("#img"+ count+1).css({'dispaly' : 'inline'});
//$("'#img'+ count, '#img'+ count+1").fadeIn(5000);
//$("#img"+ count+", #img"+ count+1).show();
if(count+1 = size){
count = 1;
}
else{
count++;
}
}, 5000);
}
</script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function Slider(){
var count = 1;
setInterval(function(){
alert("#img"+ count+", #img"+ (count+1));
//$("#img"+ count).css({'dispaly' : 'none'});
//$("#img"+ count+1).css({'dispaly' : 'inline'});
//$("'#img'+ count, '#img'+ count+1").fadeIn(5000);
//$("#img"+ count+", #img"+ count+1).show();
if(count+1 = size){
count = 1;
}
else{
count++;
}
}, 1000);
}
Slider()
</script>
Не правильно написал. javascript чувствителен к регистру. Смотри тут. |
| Часовой пояс GMT +3, время: 11:56. |