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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:40:28+00:00 2026-05-11T11:40:28+00:00

I’m trying to create a dialog window using JQuery. I’m making progress so far,

  • 0

I’m trying to create a dialog window using JQuery. I’m making progress so far, but running into some issues w/ the iframe… I know that iframes are usually frowned upon, but they are the only things that will meet the requirements of the project.

Anyway, I can successfully implement the resizable and draggable plugins, but I run into issues if the user drags to fast and mouses over the iframe that is contained in the dialog’s inner div. Kind of difficult to explain, but the code below should help show what is happening.

It almost seems like once the mouse crosses over the iframe, the iframe steals the focus of the mousedown event. I’m wondering if there is any way around this.

Thanks, Chris

<div id='container' style='border: solid 1px Black; padding: 10px 10px 10px 10px; height: 520px; width: 420px;'>     <iframe id='if' src='http://google.com' style='width: 400px; height: 500px;'></iframe> </div>  <script type='text/javascript' src='jquery-1.2.6.js'></script> <script type='text/javascript' src='jquery.ui.all.js'></script> <script type='text/javascript'>  $(document).ready(function()     {         $('#container').draggable();         $('#container').resizable(             {                 alsoResize: '#if'             }         ).parent().draggable();     } ); 

EDIT: In order to run the app, the jquery files referenced in the code will need to be downloaded. The code should be backwards compatible with previous versions though.

EDIT: I changed the code up a bit to simplify things a bit.

EDIT: I found an alternative method to solving this problem by using the prototype-window libraries. I would much rather use jQuery over prototype since many of the benchmarks are a lot better, but due to my time crunch the protype route will do. I’m still interested in figuring this out though if anyone has some advice. Thanks again for all your help.

EDIT: If I change the iframe to a div, the code above works flawlessly. The issue only appears to be the way that the draggable and resizable extensions function when and iframe is involved.

  • 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. 2026-05-11T11:40:29+00:00Added an answer on May 11, 2026 at 11:40 am

    @aleemb: I don’t believe that is what he’s talking about. I believe the problem to be the Iframe and not the combination of the draggable and resizable.

    @regex: I have this same issue and it also manifested itself with a prior implementation using the prototype toolkit.

    My implementation uses an Iframe as a canvas on which to drop draggables. The way you can see the bug is to move your mouse too fast so that the cursor leaves the edge of the draggable DIV. The DIV stops moving and your mouse keeps going; by moving your mouse back to the surface of the DIV, it picks up the DIV again and starts moving even if you’ve released the click on your mouse.

    My suspicion is that the Iframe events somehow interfere with the jquery events.

    My solution was to position a transparent DIV tag between the Iframe and the draggables/resizables.

    In this manner, the iframe never sees the mouse movement and as such doesn’t interfere.

    EDIT: See code sample: http://dpaste.com/hold/17009/

    Wes

    UPDATE! I revisited this issue and the iframeFix seems to work great in all browsers for the draggables, but the resizables do not have the equivalent fix.

    I used this code to manually add a mask DIV:

    $elements.resizable({ //mark it as resizable     containment: '#docCanvas',     start: function(event, ui) {         //add a mask over the Iframe to prevent IE from stealing mouse events         $j('#docCanvas').append('<div id=\'mask\' style=\'background-image:url(images/spacer.gif); position: absolute; z-index: 2; left: 0pt; top: 0pt; right: 0pt; bottom: 0pt;\'></div>');     },     stop: function(event, ui) {         //remove mask when dragging ends         $j('#mask').remove();     } }); 

    And the HTML:

    <div id='docCanvas' style='position: relative;'>     <iframe src='something.html'></iframe> </div> 

    spacer.gif is a 1×1 pixel transparent gif.

    This fixes the issue for IE7 & IE8. IE6 has trouble with z-index and can’t seem to figure out that the DIV should be between the IFrame and the resizable DIV. I gave up on IE6.

    Wes

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

Sidebar

Ask A Question

Stats

  • Questions 110k
  • Answers 110k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Whenever I lightbox or render anything over a select box,… May 11, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer Thread syntax may be static, but implementation across operating systems… May 11, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer Thank to everyone that helped here. I ended up figuring… May 11, 2026 at 9:30 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.