Jump to content
  • 0

jQuery animate()


Aroused
 Share

Question

Здрасте, еще раз :)

Проблема второго цикла, всё работает кроме анимации :facepalmxd: , в чем дело не могу понять. :dash:

Что не так с анимацией второго цикла? Подсажите :rolleyes: пожалуйста.


for(var n = 0; param.vis_block - 1 >= n; n++){
var curr_block = container.children('div:eq('+n+')');

if(typeof curr_block != 'undefined'){

//animate news_block
curr_block.stop(false, true).animate({'top': '+='+step}, 100)

//animate inner images
for(var m = 0; param.inner_img_max - 1 >= m; m++){
if(typeof curr_block.children('img:eq('+m+')') != 'undefined'){
curr_block.children('img:eq('+m+')').stop(false, true).animate({'top':'+='+parastep}, 10); // НЕ РАБОТАЕТ!!!
alert(parastep); // РАБОТАЕТ!!!
alert(m); // РАБОТАЕТ!!!
}else{
m = param.inner_img_max + 1; // я надеюсь что это останавливает цикл =D
}
}
}
}

DOM


<div id="news_1" class="news_block" style="top: 0px;">
<img height="600px" width="760px" src="/data/news/block/calibrate/cycle.png">
<img height="600px" width="760px" src="/data/news/block/calibrate/point.png">
<img height="600px" width="760px" src="/data/news/block/calibrate/point.png">
<img height="600px" width="760px" src="/data/news/block/calibrate/point.png">
<img height="600px" width="760px" src="/data/news/block/calibrate/point.png">
<img height="600px" width="760px" src="/data/news/block/calibrate/point.png">
<img height="600px" width="760px" src="/data/news/block/calibrate/point.png">
</div>

Edited by Aroused
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy