Flip JQuery 插件不工作
我正在为一个项目制作一个网站,我发现并决定使用 jquery Flip 插件 ,而且它不起作用...我不久前确实设法让它工作,但从那以后就不能了。请记住,我还没有制作网站的图形部分,所以那里的内容仅供展示。
这是该网站的源代码。
没有错误,只是不起作用(翻转所述框)。正如我所说,它以前可以工作,但是当我添加其他盒子时,它就停止工作了。
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.
Here's the source code for the website.
No errors, just not working (fliping said boxes). As I said, it worked before, but when I added those other boxes, it stopped working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Flip 插件之前包含 jQuery UI。由于 Flip 插件需要 jQuery UI 才能使用,如果不可用,它可能会失败。
使用插件文档网站上的演示作为模板总是一个好主意。 Flip 插件按以下顺序包含 JS 文件:
此外,在 JSFIddle 中,您必须使用资源的绝对 URL,JSFiddle 不会神奇地找到
jquery/jquery.flip.min.js
。这是 JSFiddle 的更新版本,我从插件的文档中获取了上述文件:http://jsfiddle。 net/mNQJB/2/
如果上述方法未能解决您的问题,则您的代码存在错误,
.flip
调用之一包含无效的内容 财产:
确保您的
content
属性全部位于一行,或者您已正确转义结束行字符。更新
为了转义 JS 中的结束行字符,我们这样做:
注意反斜杠,它是标准的转义字符。现在,如果您想创建一个通过 HTML 呈现的新行,那么您应该使用
标记:Include jQuery UI before the Flip plugin. Since the Flip plugin needs jQuery UI to be available it probably fails when it's not.
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:
Also, in your JSFIddle, you have to use absolute URLs for the resources, JSFiddle doesn't magically find
jquery/jquery.flip.min.js
.Here is an updated version of your JSFiddle, I grabbed the above files from the plugin's documentation: http://jsfiddle.net/mNQJB/2/
If the above didn't fix your problem, there was an error with your code, one of the
.flip
calls had an invalidcontent
property:Make sure that your
content
properties are all on a single line or you have escaped the end-line characters properly.Update
To escape an end-line character in JS we do this:
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:请注意
.'
之前的换行符note the line feed prior to the
.'