Google Answers Logo
View Question
 
Q: Need a JavaScript onClick Popup Function the HTML link can pass window size to ( No Answer,   1 Comment )
Question  
Subject: Need a JavaScript onClick Popup Function the HTML link can pass window size to
Category: Computers > Internet
Asked by: etpro-ga
List Price: $15.00
Posted: 10 Jul 2005 20:00 PDT
Expires: 09 Aug 2005 20:00 PDT
Question ID: 542000
I have a number of Image/text windows I need to popup within a single
document. Rather that use a separate popup function for each, I would
like to use a generic popup function and have the various triggering
link's onClick event handlers pass the function not only the URL but
the window size required for that content.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Need a JavaScript onClick Popup Function the HTML link can pass window size
From: fell_aj-ga on 11 Jul 2005 11:56 PDT
 
<html>
<head>
<title>Popup</title>

<script language="javascript">
function NewWin (url, w, h, name)
{
        var winopts = "toolbar=no,location=no,directories=no,status=no,";
        winopts = winopts + "menubar=no,scrollbars=yes,resizable=no,";
        winopts = winopts + "width=" + w + ",height=" + h;
        remote = window.open(url,name,winopts);
}
</script>

</head>

<body>

<a href="javascript:NewWin('images/1.jpg', 400, 400, 'one');"
alt="one" title="one">One</a>
<a href="javascript:NewWin('images/2.jpg', 200, 200, 'two');"
alt="two" title="two">Two</a>
<a href="javascript:NewWin('images/3.jpg', 400, 600, 'three');"
alt="three" title="three">Three</a>
<a href="javascript:NewWin('images/4.jpg', 600, 400, 'four');"
alt="four" title="four">Four</a>

</body>
</html>

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy