| the java script for smaller pop-up windowsMay 13 2000 at 4:31 PM | mj (Login Soothfast) Forum Owner |
| Thursday, 11-May-2000 11:53:48
212.189.236.51 writes:
I forgot about this board, that's why I posted the previous question on a wrong board.
But can you let me in on the java - script for pop up windows. You know, the ones you mentioned where you can size the window to your own liking?
cheers
|
| | Author | Reply | Chaos (Login Soothfast) Forum Owner | I know, I know!!! Let me help! | May 13 2000, 4:31 PM |
Saturday, 13-May-2000 14:01:21
195.7.49.181 writes:
Here ya go:
This goes between the <head> tags:
<script language="javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
end <head>
<body bgcolor="" text="" link="" vlink="" alink=""
on-load="MM_openBrWindow('URLofpage.html','NameofPage','scrollbars=yes,width=600,height=200')">
In the body tag you fill in the usual info, plus the name of the page you want to display, the URL of the page, and the width and height. If you don't want any scrollbars, then say scrollbars=no.
|
| Chaos (Login Soothfast) Forum Owner | ah... that's if you want one to display onLoad of the page | May 13 2000, 4:32 PM |
Saturday, 13-May-2000 14:07:19
195.7.49.181 writes:
if you want to have a page like that open when you click on something, then the code is:
between the head tags again:
<script language="java script">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
Then, the image you want to click on, you write:
<a href="#" onClick="MM_openBrWindow('URL.html','NameofPage','scrollbars=yes,width=440,height=630')"><img src="image.gif" width="100" height="147" border="0"></a>
|
| Soothfast (Login Soothfast) Forum Owner | The JavaScript | May 13 2000, 4:42 PM |
This is just a repost of what I had in the Dark Tower last week, MJ. I had an answer on the old Tech Help Board, too, but it got blown away within a few hours by ITW's ongoing riot of incompetence. So here it is:
In the head of your document you need the following:
<script language="JavaScript">
<!--
function newWindow() {
oldupdateWindow = window.open('oldupdates.html', 'oldWin', 'width=330,height=260,scrollbars=yes')
}
// -->
</script>
Actually this is an example. Change 'oldupdates.html' to whatever document (or image) you intend to have opening in the custom-sized window. 'oldWin' is a name. You could change it to anything you like, like 'dilDO'. As for width and heigh, they're measured in pixels, and this is where you can customize the size of your window. If not everything is going to fit inside the window (text overflow, etc.), then have scrollbars=yes in there too. Otherwise have scrollbars=no.
For the actual link which is going to summon up this window, this is what you need:
<a href="javascript:newWindow()">CLICK HERE
</a>
Any questions?
And there's also Chaos's way, which I have not tried. There are many different ways to achieve the same end.
| |
| | Current Topic - the java script for smaller pop-up windows |
| |
|
|