Comments (2)
这段代码没有标识 panels 是要在 .J_slide 下的,你只是把调用代码放到那个匿名函数里了,当然是寻找全局的 panels 。
你应该这么写:
$(".J_slide").each(function(){
new Slide({
element: this,
panels: $(this).find('.img_contain li'),
activeTriggerClass: 'hover',
effect: 'fade',
easing: 'easeOutStrong',
interval: 2000
}).render();
});
from switchable.
@afc163 ,thx。。。
我知道你的这种写法没问题,但我觉得作为一个通用组件,里面的panels应该依赖于调用的元素,而不是自己手动地去依赖关系
from switchable.
Related Issues (20)
- Carousel的最大宽度问题 HOT 6
- 参数circular设置后滚动效果错误 HOT 7
- data-role 应该换成 data-switchable-role HOT 1
- 提交个bug HOT 2
- effects.js变更后请及时更新至SPM HOT 3
- 增加动态 add/remove 功能 HOT 1
- slide组件与tab组件panels冲突 HOT 2
- widget.js文件第一行抛出问题 HOT 4
- 是否可以增加 `multiple: false` 的情况下允许全关闭 HOT 15
- Tab组件可以延迟加载,使用Ajax获取内容吗。 HOT 2
- data-switchable-role 暂时改回 data-role
- Carousel在360安全浏览器下无法正常演示 HOT 5
- carousel 在360浏览器极速模式显示有问题 ,兼容模式下没问题 HOT 1
- arale 很多模块都没有 spm3 doc publish HOT 1
- data-switchable-role 被替换成data-role HOT 1
- switchable 如果没有在初始化的时候指定唯一的 element 参数引发的问题。 HOT 1
- 为什么 spmjs.io 上发布的 1.1.0 版没有 package.json HOT 3
- 怎么实现左右2块半透明遮罩,中间是viewsize区域这样scrollx切换
- Arale-switchable的演示挂掉了 HOT 1
- 这个插件和jquery.switchable有关系不?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from switchable.