Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Proportional Windows


Message #1 by "Laphan" <laphan@u...> on Sat, 17 Feb 2001 18:24:58 -0000
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





Message #2 by "Ken Schaefer" <ken@a...> on Mon, 19 Feb 2001 17:03:45 +1100
And what does this have to do with ASP or with Databases...? Instead of

asking us to "please take a minute to look at your problem" - why don't you

take a minute to find an appropriate list to post this question?



Cheers

Ken



----- Original Message -----

From: "Laphan" <laphan@u...>

To: "ASP Databases" <asp_databases@p...>

Sent: Sunday, February 18, 2001 5:24 AM

Subject: [asp_databases] Proportional Windows





> 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);

> }




  Return to Index