V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  mclxly  ›  全部回复第 33 页 / 共 33 页
回复总数  644
1 ... 24  25  26  27  28  29  30  31  32  33  
2014-02-13 15:39:45 +08:00
回复了 jacob 创建的主题 JavaScript 研究了 10 个小时还没搞懂,求到底原理是什么
“$(this).show();这行中的this对象吗”,这个this是遍历a元素的object
-----------------------------
程序逻辑:
-----------------------------
1. 页面加载完成后,第一次调用rotatePics();
$(document).ready(function() {
rotatePics(1);
});
2. 根据传入参数currentPhoto,在selector'#photos a'选择的元素组中,隐藏(设置透明)对应位置的元素;
$('#photos a').eq(currentPhoto).fadeOut()
3. 重新设置所有元素的z-index,并显示,下一个元素将设置为最大z-index:5,因此获得显示;
4. 一秒钟后执行步骤2,将下一个元素隐藏;
1 ... 24  25  26  27  28  29  30  31  32  33  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   906 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 19:35 · PVG 03:35 · LAX 12:35 · JFK 15:35
Developed with CodeLauncher
♥ Do have faith in what you're doing.