Flip JQuery插件不起作用 [英] Flip JQuery plugin not working

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

问题描述

我正在为一个项目建立网站,我发现并决定使用 jquery翻转插件,但它无法正常工作……我确实设法使其工作了一段时间,但此后一直无法进行.请记住,我还没有成为网站的重要组成部分,所以这里只是为了展示.

I'm making a website for a project, and I discovered and decided to use the, jquery flip plugin, and it's not working... I did manage to get it working a while ago, but couldn't since. Bear in mind I have not yet made the grafic part of the website yet, so what's there is just for show.

此处是网站的源代码.

没有错误,只是不起作用(翻转所说的方框).就像我说的那样,它以前可以工作,但是当我添加其他盒子时,它就停止了工作.

No errors, just not working (fliping said boxes). As I said, it worked before, but when I added those other boxes, it stopped working.

推荐答案

在Flip插件之前包含jQuery UI.由于Flip插件需要jQuery UI才可用,因此在没有jQuery UI时可能会失败.

Include jQuery UI before the Flip plugin. Since the Flip plugin needs jQuery UI to be available it probably fails when it's not.

使用插件文档网站上的演示作为模板总是一个好主意.翻转插件按以下顺序包含JS文件:

It's always a good idea to use the demos on the plugin's documentation website as a template. The flip plugin includes the JS files in this order:

    <script src="/lab/flip/js/jquery-ui-1.7.2.custom.min.js"></script>
    <script src="/lab/flip/js/jquery.flip.min.js"></script>

此外,在您的JSFIddle中,您必须对资源使用绝对URL,JSFiddle不会神奇地找到jquery/jquery.flip.min.js.

Also, in your JSFIddle, you have to use absolute URLs for the resources, JSFiddle doesn't magically find jquery/jquery.flip.min.js.

这是您JSFiddle的更新版本,我从插件的文档中获取了上述文件: http://jsfiddle.net/mNQJB/2/

Here is an updated version of your JSFiddle, I grabbed the above files from the plugin's documentation: http://jsfiddle.net/mNQJB/2/

如果上述方法不能解决您的问题,则说明您的代码有错误,.flip调用之一具有无效的content属性:

If the above didn't fix your problem, there was an error with your code, one of the .flip calls had an invalid content property:

未捕获到的SyntaxError:意外令牌.

Uncaught SyntaxError: Unexpected token .

请确保您的content属性全部在一行上,或者您已正确转义了结束符.

Make sure that your content properties are all on a single line or you have escaped the end-line characters properly.

要在JS中转义结束符,请执行以下操作:

To escape an end-line character in JS we do this:

var str = "This is a string and \
I want it to use two lines.";

注意反斜杠,它是标准的转义字符.现在,如果要创建将通过HTML呈现的新行,则应使用<br />标记:

Notice the backslash, it's the standard escaping character. Now if you want to create a new line that will be rendered via HTML then you should use a <br /> tag:

var str = "This is a string and <br />I want it to use two lines.";

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

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