WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] PDF is always open with Google Viewer & iframe (4 posts)

  1. jmartin01
    Member
    Posted 1 year ago #

    I know there are several topics related (and they've helped me to get this far!) But I'm still turning up issues in my effort to make pdfs open nicely in all browsers (coughfirefox, not to name names)

    Right now, the issue is that the pdf is by default open when I go to the page with the link: http://www.foodwecook.com/press/ It's not beautiful either - not centered, can't exit out of it...obviously just not functioning properly. This is happening in Firefox AND Chrome AND Safari. Oy.

    -I am using a google viewer link (the one that starts with <iframe)

    -I've given it the class fancybox-iframe

    -I've checked the iframe option in settings-media-fancybox

    -I looked back and set auto-open is set to none (should it be set to none?)

    ...to no avail...

    Can anyone help?!

    Thanks in advance,
    Jena

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. jmartin01
    Member
    Posted 1 year ago #

    In case I was unclear in my frenzy my problem more clearly stated is:

    I'm trying to use Fancybox to create a link, which when clicked opens a PDF in a fancybox.

    Right now instead of there being a link to click on, the actual PDF is open, displaying in an iframe on the page in the flow of the rest of the page content, where just a link for the fancybox should be.

    Maybe this is a stupid mistake like not marking up the iframe link correctly - I just copied the google link and put this:

    <iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fwww.foodwecook.com%2Fimages%2FBuildGreatWebsitept1.pdf&embedded=true" width="600" height="780" style="border: none;" class="fancybox-iframe">test</iframe>

    I should say that I successfully used the pdf in lightbox before but it didn't wrk in FF, which is why I've gone through all this google viewer/iframe business.

    Again, thankful in advance for any response.

  3. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    Your code

    <iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fwww.foodwecook.com%2Fimages%2FBuildGreatWebsitept1.pdf&embedded=true" width="600" height="780" style="border: none;" class="fancybox-iframe">test</iframe>

    is an iframe code which will create an iframe in your post/page content.

    If you want to create a link, then convert it to link code like:

    <a href="http://docs.google.com/viewer?url=http%3A%2F%2Fwww.foodwecook.com%2Fimages%2FBuildGreatWebsitept1.pdf&embedded=true" class="fancybox-iframe">test</a>

    You can learn all about creating links in HTML on http://www.w3schools.com/tags/tag_a.asp and about iframes on http://www.w3schools.com/tags/tag_iframe.asp :)

  4. jmartin01
    Member
    Posted 1 year ago #

    Oh my goodness - how stupid.

    Thank you.

    I actually tried this link before, but it was not opening in fancy box, I must have forgotten the class or not cleared the cache.

    Really appreciate your answering.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic