quick question

doyle369

New Member
say you have a website and on that website you have a link, and you click on the link and it opens up a new window...but I want that link to open up on smaller window...so I can see the original page behind it
 

Geodun1

New Member
You could edit the properties using Javascript the (window.innerHeight = xxpx & window.innerWidth = xxpx /* xx=deminsions */). Someone with more JavaScript expertise can help you there.
 

conor

New Member
Add this to the top of your page:

<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}

// -->
</script>

Link to it with the url:

<a href="popupex.html" onclick="return popitup('popupex.html')">Link to popup</a>
 

doyle369

New Member
Add this to the top of your page:

<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}

// -->
</script>

Link to it with the url:

<a href="popupex.html" onclick="return popitup('popupex.html')">Link to popup</a>



This is my code

_______________________________



<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
newwindow=window.open(url,'name','height=200,width =150');
if (window.focus) {newwindow.focus()}
return false;
}
<a href="first.htm" onclick="return popitup('second.html')">Link to popup</a>

// -->
</script>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<a href="second.html">fggddsgsd</a></body>
</html>

__________________________________


what am I doing wrong?
 
Last edited:

zkiller

Super Moderator
Staff member
Why would you place an HTML link inside of your script tags? Fixed it for ya.

Code:
<html>
  <head>
    <title>Untitled Document</title>
    <script type="text/javascript">
      function popitup(url) {
        newwindow=window.open(url,'name','height=200,width =150');
        if (window.focus) {newwindow.focus()}
        return false;
      }
    </script>
  </head>

  <body>
    <a href="second.htm" onclick="return popitup('second.html')">Link to popup</a>
  </body>
</html>
 
Top