Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9324945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:43:33+00:00 2026-06-19T04:43:33+00:00

I have a PDF embedded inside iframe. I need to hide this iframe on

  • 0

I have a PDF embedded inside iframe. I need to hide this iframe on click of a button. But for some reason, the iframe section does not hide in Safari browser. The same code works fine in IE, Chrome and Firefox.

Here is a snippet from my HTML page:

<div id="PDFSection" style="text-align:center;">
    <iframe id="PDFFrame" src="sample.pdf"> Loading...
    </iframe>
    <hr />
    <input id="btnEmail" type="button" value="Email" name="btnEmail"/>
</div>

and here is the jquery part I am calling to hide the div:

$(document).ready(function() {
    $( "#btnEmail" ).click(function() {
    $( "#PDFSection" ).hide();
    });
});

I have tried toggle() instead of hide() and also tried to call hide() on the iframe element itself. But nothing is able to hide the PDF object. I do see that when the jQuery code runs, it hides the PDFSection div (as I can see the button and hr line getting hidden), but the PDF stays on the screen.

Here is a screenshot of what happens before and after clicking the button:
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:43:34+00:00Added an answer on June 19, 2026 at 4:43 am

    i just tested your example:

    <html>
      <head>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script type="text/javascript">
          $(document).ready(function() {
            $( "#btnEmail" ).click(function() {
                $( "#PDFSection" ).hide();
            });
          });
        </script>
      </head>
      <body>
        <div id="PDFSection" style="text-align:center;">
        <iframe id="PDFFrame" src="about:blank"> Loading...
        </iframe>
        <hr />
        <input id="btnEmail" type="button" value="Email" name="btnEmail"/>
    </div>
      </body>
    </html>
    

    and it works fine in safari 6.0.2 (8536.26.17) on OSX Mountain Lion. Maybe you should open the developer console cmd+alt+i and look for further error messages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have open pdf file through my application.when click on device back button it
I have some pdf documents and I need to find a way to automate
I have a pdf url, embedded in a rectangular area of an iframe. I
I have a video embedded PDF file, I need to open it in an
I have a PDF with an embedded form. This form has inputs and drop-downs.
Here is the problem: We have some pdf files with youtube videos embedded in
I have some PDF files in a public rails folder. I want to set
I have some pdf files located on a http server: Like: http://domain.com/files/file1.pdf http://domain.com/files/file1.pdf http://domain.com/files/file1.pdf
We have a page where a PDF is embedded, and are trying to pop
Lets say I have some pdf files stored on my server and I only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.