4

I have an iFrame and I want the user to be able to grab one side of it and drag it to resize it. I don't want it to resize realtime, but rather use an indicator line and when the user releases, it'll resize.

I'm using jQuery.

Any help?

Shamoon
  • 41,293
  • 91
  • 306
  • 570
  • Place some DIV's at the edges of the IFRAME. Implement dragging functionality on those DIV's. At the mouseup-handler, determine the DIV position and set the IFRAME dimensions accordingly. – Šime Vidas May 31 '11 at 22:34

4 Answers4

6

As of 2020 you can simply add the CSS property resize: both or resize: vertical to the iframe element.

Sebastián Grignoli
  • 32,444
  • 17
  • 71
  • 86
6

Iirc, the classical method is to put the IFrame inside of a div and make that div re-sizable; also make the iFrame's width and height at 100%.

If you're using JQuery though, can you not use jQuery.load('uri') instead of an iFrame ? I believe it's preferable in many situations.

Russ Clarke
  • 17,511
  • 4
  • 41
  • 45
0

jQuery Resizable with an indicator as to the eventual dimensions as per your request. See Russ C's comment and link to a better solution

Matthew Nessworthy
  • 1,428
  • 10
  • 19
0

http://jqueryui.com/demos/resizable/#visual-feedback

That seems to do the trick with an iFrame inside a DIV

Shamoon
  • 41,293
  • 91
  • 306
  • 570