Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help needed with proportional windows

0 views
Skip to first unread message

Laphan

unread,
Feb 17, 2001, 1:19:13 PM2/17/01
to
Hi all,

Laphan here again requiring your expert assistance!!!!

I am creating a web site whereby the user clicks a product's button to
display a new smaller window with a pic and some text in it.

It's done through a combo of ASP for server-side and Javascript for
client-side, but I'm struggling with the concept of making the new window
proportional with the picture and text it displays.

My button is setup as follows:

<a href='#'
onClick="ShowProd('showinfo.asp?url=transformers&code=meter','1','','390','3
90','true')">

The 'url' is the URL of the ASP page that displays the text and pic, eg
transformers.asp, and the 'code' is the code of the product, eg meter. I am
currently sending the height and width of the new window as a fixed size of
390 x 390 pixels and sending the whole above data to the below Javascript:

function ShowProd(theURL,winName,features, myWidth, myHeight, isCenter) {
if(window.screen)if(isCenter)if(isCenter=="true"){
var myLeft = (screen.width-myWidth)/2;
var myTop = (screen.height-myHeight)/2;
features+=(features!='')?',':'';
features+=',left='+myLeft+',top='+myTop;
}

window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth
+',height='+myHeight);
}

The 'Transformers.asp' page then displays a 200 x 150 picture and text in
this window.

What I would like to do is find the size of pic and text (all in 1 table)
and make the window in proportion to this data. Can anybody give me any
pointers on this?

Many thanks.

Regards

Laphan


Klaus Thomsen

unread,
Feb 17, 2001, 4:12:33 PM2/17/01
to
put in head.

<SCRIPT language=JavaScript>
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',r
esizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End -->
</SCRIPT>

the link:

<a href="something"
onClick="NewWindow(this.href,'link','200','200','no');return
false;">text</a>

hope this helps, it works anyway :)

Klaus Thomsen
Denmark
www.ittw.dk/gil

"Laphan" <lap...@ukonline.co.uk> wrote in message
news:E2zj6.4115$Dd3.2...@monolith.news.easynet.net...

Laphan

unread,
Feb 21, 2001, 3:51:36 PM2/21/01
to
but the 200 x 200 is exactly the same as what I was doing?


Klaus Thomsen <k...@tv.dk> wrote in message
news:96mpcj$212e$1...@news.cybercity.dk...

0 new messages