jQuery Facebox插件不起作用 [英] Jquery Facebox plugin doesn't work

查看:96
本文介绍了jQuery Facebox插件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从famspam.com/facebox下载了facebox. 然后我将facebox.js添加到public/javascripts文件夹中,并将facebox.css添加到public/stylesheets

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

然后,在原始Jquery库版本1.4之后,我将此文件包含在application.html.erb中.

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

最后,我为href标签设置了rel属性,以尝试使用Facebox,但是它没有出现.单击带有rel="facebox"的链接时,我只在当前的浏览器选项卡中看到一张图片.

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.

请帮助我使用Facebox.

Please, help me with facebox.

推荐答案

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

Did you call facebox() onLoad?

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

这篇关于jQuery Facebox插件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆