facebox rails app

余生颓废 提交于 2019-12-24 00:36:28

问题


how do I use facebox in a Rails app knowing that I already have the jquery-rails gem installed? Need sample code that goes into the view as well. Thanks.


回答1:


Include facebox library in your application.html.erb file.

Add this code in a javascript file.

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox() 
})

View

<a href="images/stairs.jpg" rel="facebox">text</a>

There are a few simple examples and some documentation on their site https://github.com/defunkt/facebox#usage.



来源:https://stackoverflow.com/questions/5879288/facebox-rails-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!