Solved

Need to be able to resize an Iframe by using mouse drag as on a browser window.

Posted on 2003-10-29
5
1,327 Views
Last Modified: 2012-05-04
I have table data on an Iframe, which I would love to enable it to be resizable.  A reg browser window is resizable by every corner you put the mouse on when it is not maximized.  If I could get an iframe to do the same the would be wonderful.  Thanks!!
0
Comment
Question by:dgelinas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9642162
<iframe id='theFrame' name='theFrame' width='100' src='http://members.aol.com/grassblad' height='400'></iframe>
<script>
document.getElementById('theFrame').height = 200;
function handler()
{
  document.getElementById('theFrame').width = event.clientX
  document.getElementById('theFrame').width = event.clientY
}
document.onmouseup = handler;

Vinny
0
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9642436
Hi,


drag = false
function mDown()
{
  drag = true;
  if (drag) document.onmousemove = mMove;
  return false;
}

function mMove()
{
  if (drag)
  {
    document.getElementById('theFrame').height = event.clientY;
    document.getElementById('theFrame').width = event.clientX;
    drag = false;
  }
}

document.onmousedown = mDown;
//-->
</script>
</head>
<body>
<iframe id='theFrame' name='theFrame' width='100' src='http://members.aol.com/grassblad' height='200' onmousedown='mDown'></iframe>
0
 
LVL 6

Author Comment

by:dgelinas
ID: 9642678
It's very difficult to get that to get working.  I have to play around with the mousdown and dragging for  a while before it catches on anything.. How would I go about setting it to an element on the page and clicking and dragging from there?
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10346206
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10377137
PAQed, with points refunded (400)

Computer101
E-E Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question