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,211 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
Comment Utility
<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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed, with points refunded (400)

Computer101
E-E Admin
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…

762 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

6 Experts available now in Live!

Get 1:1 Help Now