Jquery 顺序淡入和淡出 - 同一位置
我有三张图片,我希望它们是
第一张图片: fadeIn,稍等片刻,然后fadeOut; 第二张图:(在同一个地方) fadeIn,稍等片刻,然后fadeOut; 第三张图:(在同一个地方) 淡入,稍等片刻,然后淡出;
//做点什么...
到目前为止我有这种愚蠢的行为。
$(document).ready(function() {
$('#imagemIntro1').fadeIn(3800);
setTimeout(function() {
$('#imagemIntro1').fadeOut(3800); }, 8000);
$('#imagemIntro2').fadeIn(3800);
setTimeout(function() {
$('#imagemIntro2').fadeOut(3800); }, 8000);
$('#imagemIntro3').fadeIn(3800);
setTimeout(function() {
$('#imagemIntro3').fadeOut(3800); }, 8000);
window.location.replace("http://www.something.com");
});
我可以请你帮忙吗?
我很想学习如何在没有特定插件的情况下做到这一点......:D “我的时间不多了,所以,我将使用建议的插件,因为这真的没什么特别的。”
提前致谢, MEM
I have three images and I would like them to
First Image:
fadeIn, wait a while, then fadeOut;
Second Image: (on the same place)
fadeIn, wait a while, then fadeOut;
Third Image: (on the same place)
fadeIn, wait a while, then fadeOut;
//do something...
I have this stupidity so far.
$(document).ready(function() {
$('#imagemIntro1').fadeIn(3800);
setTimeout(function() {
$('#imagemIntro1').fadeOut(3800); }, 8000);
$('#imagemIntro2').fadeIn(3800);
setTimeout(function() {
$('#imagemIntro2').fadeOut(3800); }, 8000);
$('#imagemIntro3').fadeIn(3800);
setTimeout(function() {
$('#imagemIntro3').fadeOut(3800); }, 8000);
window.location.replace("http://www.something.com");
});
Can I have your help please?
I would love to learn how to do this, without a specific plugin... :D
"I'm running out of time, so, I will use the suggested plugin since, this is really nothing special."
Thanks in advance,
MEM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您在循环浏览某些图像方面走在正确的轨道上。但是,您的描述中似乎没有任何特殊要求。因此,我强烈推荐 jQuery Cycle 插件。
如果你想自己做,请更新你的OP。
Looks like you are on the right track to cycle through some images. However, there is nothing in your description that seems to be a special requirement. Therefore, I would strongly recommend the jQuery Cycle plugin.
If you want to do it yourself, update your OP.
您想要做的是使用回调来执行此操作。你最终会得到一条相当丑陋的链条,但它确实有效。它看起来像这样:
What you want to do is use callbacks to do this. You end up with a pretty ugly chain, but it works. It would look something like this: