花式框,从网址抓取 [英] Fancy box, grab from url

查看:80
本文介绍了花式框,从网址抓取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个网站,正在使用引导程序和jquery ...我发现引导程序具有与fancybox完全一样的模态,但意识到它还不够好,所以我继续前进并得到了fancybox ...我最近看到一个名为PrimeDice的网站,我看到他们也正在使用fancybox,我想像他们一样设置fancybox.如果仔细研究他们的代码,您会发现他们正在得到这样的fancybox.

I was developing a site and am using bootstrap, and jquery... I found out that bootstrap has modals that is exactly like fancybox, but realized it was not good enough, so I went ahead and got fancybox... I recently saw a website called PrimeDice, and I saw that they were also using fancybox, and I want to setup fancybox, like they did... If you look into their code, you can see that they are getting the fancybox like this...

<a href="/modals/faq.html" class="action-fancybox">faq</a>

基本上,如果您访问 http://primedice.com/modals/faq,则会发生这种情况. html ,您将看到花式框的纯文本版本.我想做类似的事情,从另一个页面获取fancybox的文本或数据...因此,基本上有一个名为modals的文件夹,并有一个名为text.php的文件,然后从中获取信息,并在我的主页上将其显示为fancybox ...希望您能理解我的意思...

Basically what is happening is that if you go to http://primedice.com/modals/faq.html you will see the plain text version of the fancy box. I want to do something similar to this, where it fetches the text or data of the fancybox from a different page... So basically have a folder called modals, and have a file called text.php and then fetch the information from that, and display it as a fancybox on my homepage... I hope you understand what I mean...

这是他们的常见问题代码如下: http://pastie.org/8345073

This is what their faq code looks like: http://pastie.org/8345073

推荐答案

如果您有这个html

If you have this html

<a href="/modals/faq.html" class="action-fancybox">faq</a>

然后使用这样的jQuery代码

then use a jQuery code like this

jQuery(document).ready(function($){
    $(".action-fancybox").fancybox({
        type: "iframe"
    });
});

假设您已正确加载jQuery以及fancybox js和css文件.

Assuming that you have properly loaded jQuery as well as fancybox js and css files.

在此 JSFIDDLE

See it working in this JSFIDDLE

这篇关于花式框,从网址抓取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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