set jquery ThickBox size to auto
Asked Answered
S

1

10

I use JQuery ThickBox 3.1 to show my Iframed Content as popup window .

 <a href="popUp.aspx?id=<%#Eval("id")%>&TB_iframe=true&height=600&width=800" 
 title='<%#Eval("Title")%>' class="thickbox">
 <img id="thumbnailImage" runat="server" src='<%#Eval("ImagePath")%>' 
 alt="Single Image"  width="180" style="max-height:220px"/></a></div>

When I click 'thumbnailImage' , the page 'popUp.aspx' will show as a popup window .
As you see , i give the size of popup window to height=600&width=800" ,
but I have a table with( width:auto ) , thus the width of my table may change dynamically !

I want to know how to set the value of thickBox's width and height to auto .

You can see thickBox's css file and javascript file !

Skyrocket answered 11/5, 2013 at 7:57 Comment(1)
First you need to create a working fiddle, with the bug. Start here: jsbin.com/ezivij/1Krefeld
A
2

Not sure if I understood everything correctly, but if your table is inside an iframe you have to know that an iframe is a boundary for many things in your page.

In particular, layout doesn't flow through an iframe. There's the inside of the iframe and the outside. They leave in completely separated worlds and there is no way that the size of your table (which lives in the document inside the iframe) can influence the size of the iframe itself -- or anything that lives in the document outside the iframe.

If you don't get rid of the iframe your only solution is to use javascript to copy the size from the document inside the iframe to the iframe itself. Of course, this is assuming a script is allowed to do that, i.e. you don't have cross-site scripting issues (your iframe and the main document must come from the same origin).

For clarification and to properly answer: you ask the wrong question. Setting thickbox size to 'auto' will not help you. You must set thickbox size to the actual value dynamically.

Aldin answered 29/5, 2013 at 23:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.