Code Snippets¶
2D Mode¶
1 2 3 4 5 6 7 8 | var cs3d = new CarouselStack(el, {
useFullscreen:false,
force2d:true,
gal2d:{
maxScale:0.75,
distance:300
}
});
|
Enable Mouse Dragging¶
1 2 3 | var cs3d = new CarouselStack(el, {
useMouseDrag:true
});
|
Enable Mouse Camera¶
1 2 3 | var cs3d = new CarouselStack(el, {
mouseCam:true
});
|
Enable Auto play¶
1 2 3 | var cs3d = new CarouselStack(el, {
useAutoplay:true
});
|
Enable Looping¶
1 2 3 | var cs3d = new CarouselStack(el, {
loop:true
});
|
Change general container size¶
1 2 3 4 5 6 | var cs3d = new CarouselStack(el, {
mediaviewer:{
containerWidth:500,
containerHeight:300
}
});
|
Custom AJAX processing¶
1 2 3 4 5 6 7 | var cs3d = new CarouselStack(el, {
mediaviewer:{
ajaxProcessor:function(con, req) {
con.innerHTML = req.responseText;
}
}
});
|
Full Width¶
1 2 3 4 5 | <style>
.rs-cs3d {
width:100%;
}
</style>
|
Add event handlers¶
1 2 3 4 5 6 7 8 9 10 11 | cs3d.addEventListener('target', function(e) {
console.log(e.detail);
});
cs3d.addEventListener('cload', function(e) {
console.log(e.detail);
});
cs3d.addEventListener('cloadcomplete', function(e) {
console.log(e.detail);
});
|
Create distributions¶
grunt dist
Build example files¶
grunt examples
Compile pug templates¶
grunt pug
Compile SASS¶
grunt compass
Watch files for changes¶
grunt watch