OkzoomRails
This is a Rails implementation of OkZoom.js -- OKZoom is a jQuery plugin that produces a portable loupe of variable size and shape.
Installation
Add this line to your application's Gemfile:
gem 'okzoom_rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install okzoom_rails
Usage
add in app/assets/javascripts/application.js
after jquery (below jquery)
//= require okzoom
and then in your view
<%= image_tag ('http://okfoc.us/okzoom/img/fra2.jpeg'),
:width => "40%", :id => "example2" %>
or
<!-- the image need to be smaller that's why you need to add a css property 'width' -->
<img id="example" src="http://okfoc.us/okzoom/img/fra2.jpeg" style="width:40%">
<script type="text/javascript">
$(function(){
$('#example').okzoom({
width: 200,
height: 200
});
$('#example2').okzoom({
width: 200,
height: 200
});
});
</script>
Contributing
- Fork it ( https://github.com/guinslym/okzoom_rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request