famo.us - code like Lightbox example -


i'm searching code example of lightbox demo famo.us. unfortunately, interesting part of app in codepen uglified in pens version of famous.lib.js.

it's not whole gallery thing i'm interested in, "just" scollable view multiple elements in 1 row, depending on size , screen size.

has experiences in developing view/layout this?

thanks in advance

i have been doing work scrollview , gridlayout. can calculate grid dimensions based on contextsize , target/min cell size.

here example started. adding gridlayout sole view in scrollview. know may work against scrollviews efficient rendering in scrollview rendering entire grid, doing examples sake. use modifier around gridlayout ensure size of view calculated , scrollview scrolls right amount. anyway, here did..

var engine          = require('famous/core/engine'); var surface         = require('famous/core/surface'); var rendernode      = require('famous/core/rendernode'); var modifier        = require('famous/core/modifier'); // edited var scrollview      = require('famous/views/scrollview'); var gridlayout      = require('famous/views/gridlayout');  var context = engine.createcontext();  var scrollviews = [];  var scrollview = new scrollview(); scrollview.sequencefrom(scrollviews);  var gridcells = [];  var grid = new gridlayout(); grid.sequencefrom(gridcells);  grid.mod = new modifier();  var cellcount     = 24; var cellminwidth  = 200.0;  grid.mod.sizefrom(function(){    var size        = context.getsize();   var cellsx      = math.floor(size[0] / cellminwidth);   var cellsy      = math.ceil(cellcount * 1.0  / cellsx);   var cellheight  = size[0] * 1.0 / cellsx;    grid.setoptions({dimensions:[cellsx,cellsy]});    return [undefined,cellsy*cellheight]; });  grid.node = new rendernode(); grid.node.add(grid.mod).add(grid);   (var = 0; < cellcount; i++) {   var surface = new surface({     size:[undefined,undefined],     properties: {       backgroundcolor:'hsl('+(i*360/12)+',75%,50%)'     }   });    gridcells.push(surface);   surface.pipe(scrollview);  };  scrollviews.push(grid.node);  context.add(scrollview); 

fwiw maximize efficiency of scrollview, need have list of views rendered sequentially. since rendering 1 view in scrollview, rendering everything, time. have thought of couple ways around though, both extend beyond scope example.

  1. you visibility check , render nodes based on position of scrollview.

  2. you create gridlayout each row, manage cells within each grid using list manipulation techniques.

bonus:

if want use gridlayout modifiers, found using _modifiers property rather helpful (note: available after deploy!). able create rearrangeable layout using technique. surfaces floating outside gridlayout , being positioned via draggable modifier based on gridlayouts modifiers. here working demo of that..

http://higherorderhuman.com/examples/rearrangeable.html

hope helps!


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -