Editing WordPress Add-on

I’m trying to get this wordpress add-on to load HTML pages. I’ve been informed that I have to load it into a iFrame it currently loads images without a problem all done within WordPress, but I’m stuck.

Refer to the Fancybox documentation:
http://fancybox.net/howto

Skip steps 1 and 2 as they are what the plugin did for you.

You do not need to edit the addon, just add the javascript snippet to your head to attach the fancybox function to the link you want it to show.

just add the javascript snippet to your head to attach the fancybox function to the link you want it to show

Which snippet if I’m suppose to skip steps 1 & 2 ?

What fancybox function ? :slight_smile:

Step 3 & 4…

Dan I’m suppose to put the code in Step 4 with in my head ? And then the iFrame for the link so that it loads FancyBox ? Sorry I have to make sure because the code in Step 4 seems a bit odd to be placing in the head, but if I run it within a script code?

It goes in a script tag in the head. It is JavaScript code.

Have you tried any of the example links in the Content Demos section of the plugin homepage to see if it works without having to make any changes? According to that page, once the plugin is activated it should be ready to use.

Agarcia831 - What you see on that page works perfectly without any changes if your only working with images. I want FancyBox to load a HTML page, in which I have to put the script into the head of the page. I’m going to get some test page whipped together hopefully in a day or two and try it out !

Actually the page he linked has examples for webpages not just images. You should give those a try, looks like it is already be set up.

<a class="fancybox iframe" href="http://www.google.com/">This link opens another page in an Iframe</a>

Dan - I’m suppose to take this code and put it in a <script> tag ? Then turn a anchor link using this code:

<a href=“http://www.example?iframe”>This goes to iframe</a>

In that code you see above this sentence I don’t see where it would tell fancy box to load the anchor link as a HTML file within FancyBox ?

<script>$(document).ready(function() {

/* This is basic - uses default settings */

$("a#single_image").fancybox();

/* Using custom settings */

$("a#inline").fancybox({
	'hideOnContentClick': true
});

$("a.group").fancybox({
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'overlayShow'	:	false
});

});</script>

Just make a normal link, in your page, and put class=“fancybox iframe” on it. That’s all.

I must be doing something wrong, because I put that code as a anchor on my blog post and the anchor link does not call up FancyBox as in there example ??

<a class=“fancybox iframe”=http://www.google.com>This link</a>

What I’m doing, the post shows the code rather then the link.

Try a properly formed href attribute:

<a class=“fancybox iframe” href=“http://www.google.com”>This link</a>

That doesn’t work either. I’m beginning to wonder that’s it’s not as straight forward as it’s made out to be.

when editing your post, make sure you’re entering the code with the HTML tab selected and not the Visual tab.

<a class=“fancybox iframe” href=“http://www.google.com”>This link</a>

That worked but it’s not loading the page in FancyBox and I do have it enabled it’s just loading it in the same window.

Can you post a link to the trial page you’re working on?

All I’m doing is a simple test whereas I’m creating a link that should load Google within fancy box but as I mentioned the link works but it doesn’t load it within FancyBox.

It may be only a minor error preventing Fancybox from working. Providing a link to the page is the quickest way to get effective help.