Popup Size

J

Jason .

Is there a way to dynamically size a popup object?

i.e.
function getMetricDesc(sDescription) {
var oPopup = window.createPopup();
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = sDescription
oPopupBody.style.border = "1 solid black"
oPopupBody.style.backgroundColor = "#ffffcc";
oPopup.show(30, 20, 775, 400, window.event.srcElement);-->
}
I need the paramater of 400 in the oPopup.show to be dynamic due because
I will not know the length of text to populate the popup. I guess an
alternative solution would be to add scroll bars but is that possible
with this object?
 
H

Hywel Jenkins

Is there a way to dynamically size a popup object?

i.e.
function getMetricDesc(sDescription) {
var oPopup = window.createPopup();
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = sDescription
oPopupBody.style.border = "1 solid black"
oPopupBody.style.backgroundColor = "#ffffcc";
oPopup.show(30, 20, 775, 400, window.event.srcElement);-->
}
I need the paramater of 400 in the oPopup.show to be dynamic due because
I will not know the length of text to populate the popup. I guess an
alternative solution would be to add scroll bars but is that possible
with this object?

Set MyVarHere to whatever you want the dimension to be.

oPopup.show(30, 20, 775, MyVarHere, window.event.srcElement);
 
J

Jason .

That's the easy part. How do I go about determining the size (height)
based on the text that should be displayed?

Not all descriptions have the same amount of text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,413
Latest member
KeiraLight

Latest Threads

Top