Here's something I knocked up - hope it guides you!

<html>
<head>
<title>Test</title>
<script language="javascript">

function launchHrefToSpecifiedDimension(divRef, link) {

   var width = getElementWidth(divRef);
   var height = getElementHeight(divRef);
   thiswindow = window.open(link, "thiswindow", 'width=' + width,
'height=' + height);
}

function getElementHeight(Elem) {
    var xPos;
                 if (document.getElementById){
                        var elem = document.getElementById(Elem);
                        xPos = elem.offsetHeight;
                }
        return xPos;
        } 

function getElementWidth(Elem) {
    var yPos;
         if (document.getElementById){
                        var elem = document.getElementById(Elem);
                        yPos = elem.offsetWidth;
                }
        return yPos;    
}

</script>
</head>
<body>


<div>
<a href="#"
onclick="javascript:launchHrefToSpecifiedDimension('testdiv',
'http://www.google.com');return false;">Launch</a>
<div id="testdiv" style="width:100px; height:100px;">Testing DIV</div>
</div>
</body>
</html>



 
Edit the width and height in the div, see what happens. I have not
tested this, so it may need some work!

Martin


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Phil Turner
Sent: 02 May 2007 15:41
To: CSS
Subject: [css-d] page opening sizes

I 've created a page link here
http://www.philturner-uk.com/kruger/davinci.html

under roll towel click on the more product details link.

I used to do this as a javascript pop up but just want the page to open
limited in size to the width of the wrapper div, how do I do this?
Do I just specify the page size in the body {

can someone point me in the right drection


Phil Turner
FREELANCE DESIGNER
TEL: 0161 439 1669
Chartered Graphic Designer MCSD  BA Hons [EMAIL PROTECTED]
http://www.philturner-uk.com V I S I T  M Y  D E S I G N  B L O G
http://www.philturnerdesigner.blogspot.com/

NEW BOOK - YOUR PLANET NEEDS YOU
http://www.yourplanetneedsyou.org


______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org
-- http://www.evolt.org/help_support_evolt/


 


This message has been scanned for malware by SurfControl plc. 
www.surfcontrol.com
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to