Posts Tagged ‘javascript’

jQueryUI: draggable + selectable

Posted in to do on July 14th, 2013 by ericsoco – 1 Comment

Across the tubes, there are many hints toward getting jQueryUI’s draggable and selectable widgets to play nice with each other.

However, they all come back to a technique laid out in a post by Ryan Coughlin back in 2008. The basic strategy comes down to this:

  • use selectable() to enable marquee (lasso) selection and click-container-to-deselect;
  • use a click handler to manually set jQueryUI selectable classes (‘.ui-selectable’, etc)
  • hook into draggable() to copy the offset to all selected elements.

I modified a jsfiddle from a Stack Overflow post on the topic with clearer comments and updated jQuery (v1.9.1) and jQueryUI (v1.10.3) libs. Here it is:

Strobe player for Shadowbox.js

Posted in to do on May 21st, 2012 by ericsoco – Be the first to comment

Shadowbox is lovely — easy to use, well-written and fairly well-documented, and has a nice player architecture for supporting media types other than those packaged with the library.

There isn’t great support out-of-the-box for FLV content, just the JW FLV Player, and for various reasons, I’m not really a fan.  I wanted something simpler and cleaner, and I found out about the Adobe Strobe media player. (Download it from sourceforge here.)

To be honest, I wrote this a while back and have been quite busy since, and I don’t remember exactly why I found Strobe to be such a better option.  But for those who agree with that sentiment, feel free to drop in the Strobe player for Shadowbox I whipped up, just for you.  It plays FLVs, Quicktime .mov files, and all other media formats supported by Flash.  And, it falls back to the HTML5 video player when Flash is not available.

To use it, add strobe.js to your Shadowbox source/players folder, edit the players array in build.yml to include ‘strobe’ (no quotes), and rake it back together as shown here.