Make sly responsive?

1,824 views
Skip to first unread message

rudol...@gmail.com

unread,
Apr 10, 2013, 5:31:26 AM4/10/13
to sly...@googlegroups.com
Is there an option to make this plugin fully responsive? Either through an update of this plugin or with a workaround?

Thanx in advance.

Sly.js

unread,
Apr 10, 2013, 6:18:53 AM4/10/13
to sly...@googlegroups.com
That's what the .reload() method is for. It's upon you when you are gonna call it, as it is completely dependent on a style, layout, and behavior of your website.

stefan cova

unread,
Apr 22, 2013, 8:16:27 AM4/22/13
to sly...@googlegroups.com
Hi,
I'll to try to use Sly in a responsive way :

On window resize, i set the witdh of the slidee, then I call sly.reload().
It's work fine, except that sly trigger a moveStart event when the window is resizing, and move to the next of prev slide.

Do you know if there's a workaround to fix that, maybe doing something like this : 
 window.onresize, function(){
  var sly = $scroller.data('sly');
  sly.stop();
  setSlideeWith();
  sly.reload();
});

Sly.js

unread,
Apr 22, 2013, 9:17:43 AM4/22/13
to sly...@googlegroups.com
There isn't. When you reload, Sly has to re-snap items (if you are using itemNav) due to the changes in sizes, which inherently changed item positioning offsets.

The moveStart event is triggered when Sly starts moving. That happens because it has to re-snap the items (described above).

Also, .stop() method, as is described in the documentation, stops only a continuous movement animation initiated by .moveBy() method. Nothing else. It won't stop any other animations.

Making reload method smarter so it would work better when called after you resize items in forceCentered navigation is on my do to list, but no ETA.
Reply all
Reply to author
Forward
0 new messages