0

I've just created a tshirt shop to put on my own website. A company called spreadshirt.co.uk (hereafter "SS") runs the shop. They allow me to embed their shop on my site via an iframe, and since they allow the CSS to be fully customisable through their admin panel I've got it looking pretty neatly integrated with my site.

The only catch is the iframe - I've set it to 2000 pixels high at the moment (just right for the longest pages). I'd rather have it resize for each page, but expect that to be "hard" so didn't bother.

Anyway, I've just put the page live, and put a test order through it. All is good, until....

...the "Verified by VISA" page. This motherhubbard turns up right at the end of the order process, and the HTML contained in it puts the little dialogue centred vertically in my iframe. I.e. nearly 1000 pixels down from the top - making less savy users think the page hasn't loaded (all they can see without scrolling down is a white background). I can't customise the CSS on this page like I can the SS pages, as this page isn't served up by SS.

Any clever ideas???

Many thanks people!

I'll put a link to my site if people want to see it, but assumed that might be seen as spammy and frowned upon.

James A Mohler
  • 10,562
  • 14
  • 41
  • 65
Codemonkey
  • 649
  • 1
  • 6
  • 11

1 Answers1

0

I don't deal with iframes too much as i hate them, but i think you can still write to that document using javascript. Reason i say maybe is because its cross domain, but it should still work.

Check this post out Resizing an iframe based on content

You could also check out Resizing iframe to fit its content

and a jquery script: http://www.lost-in-code.com/programming/jquery-auto-iframe-height/

Again, I really don't know if this will work on a cross-domain website.

Community
  • 1
  • 1
Matt
  • 6,397
  • 7
  • 44
  • 72
  • reg. last link: Please note that this jQuery autoHeight plugin will not work with iFrames accessing content from a different domain or remote location – knb Dec 12 '10 at 21:55