Jquery Facebox plugin doesn't work

南笙酒味 提交于 2019-12-12 05:36:53

问题


I downloaded facebox from famspam.com/facebox. Then I added facebox.js to be in public/javascripts folder, and facebox.css in public/stylesheets

Then I included this files in my application.html.erb AFTER original Jquery library ver 1.4

The last, I set a rel attribute to my a href tags to try to use Facebox, but it doesn't appear. When clicking on the link with rel="facebox", I just see a picture in my current browser tab.

Please, help me with facebox.


回答1:


Did you call facebox() onLoad?

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



回答2:


Also you need to set where is the images (close image and load image)

$(document).ready(function() {
$.facebox.settings.closeImage ='http://www.yoursite.com/functions/closelabel.png'
$.facebox.settings.loadingImage = 'http://www.yoursite.com/functions/loading.gif'
$('a[rel*=facebox]').facebox();   
});


来源:https://stackoverflow.com/questions/2176141/jquery-facebox-plugin-doesnt-work

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