简体   繁体   English

jQuery Facebox插件不起作用

[英]Jquery Facebox plugin doesn't work

I downloaded facebox from famspam.com/facebox. 我从famspam.com/facebox下载了facebox。 Then I added facebox.js to be in public/javascripts folder, and facebox.css in public/stylesheets 然后我将facebox.js添加到public / javascripts文件夹中,并将facebox.css添加到public / stylesheets中

Then I included this files in my application.html.erb AFTER original Jquery library ver 1.4 然后,在原始Jquery库版本1.4之后,我将此文件包含在application.html.erb中

The last, I set a rel attribute to my a href tags to try to use Facebox, but it doesn't appear. 最后,我为href标签设置了rel属性,以尝试使用Facebox,但该属性没有出现。 When clicking on the link with rel="facebox" , I just see a picture in my current browser tab. 单击带有rel="facebox"的链接时,我仅在当前浏览器选项卡中看到一张图片。

Please, help me with facebox. 请帮我使用Facebox。

Did you call facebox() onLoad? 您是否在onLoad上调用facebox()?

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM