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,251 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
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

809 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