Code Snippets

2D Mode

1var sg3d = new SphericalGallery(el, {
2  useFullscreen:false,
3  force2d:true,
4  gal2d:{
5    maxScale:0.75,
6    distance:300
7  }
8});

Enable Mouse Dragging

1var sg3d = new SphericalGallery(el, {
2  useMouseDrag:true
3});

Enable mouse moving mode

1var sg3d = new SphericalGallery(el, {
2  control:'mousemove'
3});

Enable mouse draggin mode

1var sg3d = new SphericalGallery(el, {
2  control:'mousedrag'
3});

Change general container size

1var sg3d = new SphericalGallery(el, {
2 mediaviewer:{
3   containerWidth:500,
4   containerHeight:300
5 }
6});

Custom AJAX processing

1var sg3d = new SphericalGallery(el, {
2 mediaviewer:{
3   ajaxProcessor:function(con, req) {
4     con.innerHTML = req.responseText;
5   }
6 }
7});

Full Width

1<style>
2   .rs-sg3d {
3      width:100%;
4   }
5</style>

Add event handlers

 1sg3d.addEventListener('target', function(e) {
 2  console.log(e.detail);
 3});
 4
 5sg3d.addEventListener('cload', function(e) {
 6  console.log(e.detail);
 7});
 8
 9sg3d.addEventListener('cloadcomplete', function(e) {
10  console.log(e.detail);
11});

Create distributions

grunt dist

Build example files

grunt examples

Compile pug templates

grunt pug

Compile SASS

grunt compass

Watch files for changes

grunt watch