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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

820 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