Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 57c40497b6
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (42 sloc) 1.375 kb

Edgecase

Elements that scale with the browser window size. Use the Edgecase.Concrete class to create scaleable elements.

var boxed = new Edgecase.Concrete('#image', {
    aspectRatio: 16 / 9,
    container:   '#box'
});

boxed.setup();

Alternatively, roll your own implementation by using the Edgecase module as a mixin.

Widescreen = new JS.Class({
    include: Edgecase,

    initialize: function(video) {
        this.setElement(video.getHTML());
        this.setContainer(video.getContainer());
        this.setAspectRatio(16 / 9);
    }
});

EdgeGallery is lightweight gallery that fills the viewport, built on Edgecase.

var json = {
    "images": [
        {
            "uri":         "/images/first.jpg",
            "description": "The first image",
            "width":       1024,
            "height":      768
        },

        {
            "uri":         "/images/second.jpg",
            "description": "The second image",
            "width":        1280,
            "height":       960
        }
    ],

    "rotate":        "auto",
    "rotationTime":  5.0,
    "animationTime": 0.5
},

gallery = EdgeGallery.fromJSON(json);
gallery.insertInto(document.body);
Jump to Line
Something went wrong with that request. Please try again.