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,230 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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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-…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now