Code Snippets

2D Mode

1
2
3
4
5
6
7
var pt3d = new PhotoTile(el, {
  force2d:true,
  gal2d:{
    maxScale:0.75,
    distance:300
  }
});

Enable mouse drag

1
2
3
var pt3d = new PhotoTile(el, {
  useDrag:true
});

General container size

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

Custom AJAX processing

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

Full width

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

Add event handlers

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

pt3d.addEventListener('cload', function(e) {
  console.log(e.detail);
});

pt3d.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