Coder Social home page Coder Social logo

jumbotron's Introduction

Jumbotron

Fill your background with a video.

A simple jQuery plugin to scale and center a video to fill the background of a webpage.

Installation

bower install jumbotron

Usage

  1. Create a wrapper div with a video inside
<div id="jumbo">
  <video src="http://vjs.zencdn.net/v/oceans.mp4" autoplay loop muted></video>
</div>
  1. Call jumbotron() on the wrapper element
// default
$("#jumbo").jumbotron()

// with options
$("#jumbo").jumbotron({interval: 500})

Notes

The plugin will resize the wrapper to fill the screen and make the wrapper fixed position with a z-index of -100. If your document is taller than the window, the video will stay fixed in the background as you scroll.

The plugin also sets a default interval of 500ms to resize the video. This handles both video loading and window resizing. If the video takes a seconds to load, the interval will pick up the aspect ratio when the video loads and resize to fill screen. Similarly when the user resizes the window the interval will resize the video to fill new window size. You can configure this interval with the interval option.

jumbotron's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.