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 8778799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:37:05+00:00 2026-06-13T19:37:05+00:00

I have a click event bound to a div element, inside this div I

  • 0

I have a click event bound to a div element, inside this div I am embedding an SVG file using an iframe (I have tried with object/embed elements an the result is the same) like so:

<div id="example">
 <iframe src="example.svg" type="image/svg+xml" width="100%" height="100%"></iframe>
</div>

When I add the iframe element, it’s parents click event no longer fires.

If I embed the SVG in an IMG element all is fine but the svg scaling no longer works correctly.

Is there an elegant workaround for this?

Thanks in advance.

  • 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-13T19:37:06+00:00Added an answer on June 13, 2026 at 7:37 pm

    you can try to mask the iframe

    <html>
      <head>
        <style type="text/css">
          #wrapper {
            width:1000px;
            height:600px;
            position:relative;
          }
          #wrapper:after {
            content:'';
            position:absolute;
            width:100%;
            height:100%;
            top:0;
            left:0;
            z-index:2;
          }
        </style>
      </head>
      <body>
        <div id="wrapper" onclick="alert('hi mondo');">
          <iframe src="harvest.svg" type="image/svg+xml" frameborder="0"
                  style="width:100%;height:100%;"></iframe>
        </div>
      </body>
    </html>
    

    the problem with this solution is that the context menu isn’t relative to the image anymore.

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

Sidebar

Related Questions

I have the following line bound to a click event: $(this).parents(.addonoptions).children().removeClass(highlight); It should strip
i have a click event for $('#blah div'). div has text inside of it
I have the following click event $(.element).click(function() { var idNum = $(this).getID; $('#new-'+idNum).fadeIn(); });
I have a div with a click event bound to it. I want to
Say you have this div: <div id="foo">bar</div> And you do this: $("#foo").click(someFunction); somewhere inside
I have two functions bound to a click event at two different times (using
I have the following code bound to the click event of a button: function
I have a menu click event that looks something like this.... Public Sub ToolbarManager_ToolClick(sender
If I have a jQuery .click() event firing for both body and a div,
Tried to bind submit event (or click or whatever) to an element within a

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.