Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby JavaScript
branch: master

This branch is 39 commits behind kyparn:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
vendor/assets
.gitignore
.rvmrc
.travis.yml
CHANGELOG.md
Gemfile
MIT-LICENSE
README.md
Rakefile
fancybox2-rails.gemspec

README.md

fancybox2-rails

Build Status

Use fancybox with rails 3.1 asset pipeline.

Installation

This gem vendors jquery fancybox 2 for Rails 3.1 and greater. The files will be added to the asset pipeline and available for you to use.

First add the following lines to your applications Gemfile:

gem 'jquery-rails'
gem 'fancybox2-rails', '~> 0.2.1'

Then run bundle install to update your application's bundle.

Now you need to edit your app/assets/javascripts/application.js file and add the following line:

//= require jquery
//= require fancybox

And then edit your app/assets/stylesheets/application.css file to look something like:

/*
 *= require_self
 *= require fancybox
 *= require_tree .
 */

That's it!

Usage

With the gem installed and included in your asset manifests, you can now use fancybox as you normally would.

$(document).ready(function() {
  $("a.fancybox").fancybox();
});

More information

This gem is based on the original gem for Fancybox 1.x by Chris Mytton.

License

Please be aware that you'll need to purchase a license if you intend to use fancybox2 for commercial purposes.

Something went wrong with that request. Please try again.