Giter Club home page Giter Club logo

jquery-space-frame's Introduction

Space Frame


Space Frame

Space Frame allows you to use up to 4 pieces of content to transition between using a scrubber. You can use 2 pieces of content and restrict movement to just horizontal or vertical as well.

The example above (as well as the demo) use 4 images, but you can use any html content to transition between.

Support

  • Chrome
  • Firefox
  • Safari
  • IE9

Dependencies

Getting Started

Install with bower

bower install [email protected]:brewster1134/jquery-space-frame.git -S

Or... Download the JS Download the CSS

HTML

To use a 2 panel space frame, add a space-axis-x or space-axis-y class to the space-frame element. x will create a left/right space frame on the x axis, and y will create a top/bottom space frame on the y axis.

Panels are not only restricted to images. Any content can be used however the space frame is sized based on the computed width/height of the first panel. Being explicit with the sizing of content will present more desirable results :)

<div class="space-frame" id="four_panel">
  <div class="space-panel"><img src="kitty.jpg" /></div>
  <div class="space-panel"><img src="kitty_red.jpg" /></div>
  <div class="space-panel"><img src="kitty_green.jpg" /></div>
  <div class="space-panel"><img src="kitty_blue.jpg" /></div>
  <div class="space-scrubber"></div>
</div>

<div class="space-frame x" id="two_panel_left_right">
  <div class="space-panel"><img src="kitty_red.jpg" /></div>
  <div class="space-panel"><img src="kitty_blue.jpg" /></div>
  <div class="space-scrubber"></div>
</div>

<div class="space-frame y" id="two_panel_top_bottom">
  <div class="space-panel"><img src="kitty_green.jpg" /></div>
  <div class="space-panel"><img src="kitty_blue.jpg" /></div>
  <div class="space-scrubber"></div>
</div>

JS

Initialize the space frame.

The space frame sets its size based on the width and height of the first panel. This means the content needs to be loaded, or the size explicitly set before initializing the space frame.

  • Explicitly set the width and height on the .space-panel elements with CSS
  • If you are using images, you can use a library such as imagesloaded or explicitly set width and height on your space-panels to ensure the desired behavior.
  • You may also be able to use jquery's .load event.
$('.space-frame').space-frame();

Demo

A full working demo is available at demo/index.html

Development

Dependencies

yuyi https://raw.githubusercontent.com/brewster1134/jquery-space-frame/master/yuyi_menu
bundle install
npm install
bower install

Do NOT modify any files in the dist directory! Modify the files in the src directory and compile them into the dist directory.

This will be done automatically if you are running the tests with testem (see the Testing section below)

Testing

Run testem

Release History

(Nothing yet)

TODO

jquery-space-frame's People

Contributors

brewster1134 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.