Giter VIP home page Giter VIP logo

fancybox-rails's Introduction

fancybox-rails

Use fancybox 1.3.4 with rails 3.1 asset pipeline.

Note

In this fork Fancybox 1.3.4 was patched to work with jQuery 1.9+, see this Stackoverflow solution.

Installation

This gem vendors jquery fancybox 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 'fancybox-rails'

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();
});

fancyBox 2.0

If you want to use fancyBox 2.0 then check out fancybox2-rails.

gem 'fancybox-rails', :git => 'https://github.com/sverigemeny/fancybox-rails'

Please be aware that the license has changed in the new version and you'll need to purchase one if you intend to use that fork for commercial purposes.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More information

Build status

Build Status

Useful links

Copyright (c) Chris Mytton

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.