PDA

View Full Version : Containerless Popup


Natipuss
08-13-2002, 09:07 AM
Hi

IŽd like to know if there is a way to call a containerless popup without specifying the URL straight away. I want to call a containerless popup which then loads different content when other links on the Parent page are clicked. (I hope u all know what I mean) If this is not possible IŽd be just as greatfull for any other tips on containerless popups.

Its real important (job depends on it and all that) so IŽd love to hear your answers *beg*

Natipuss

duniyadnd
08-13-2002, 11:14 AM
okay, so i presume you want a window to open and keep it in the background which will then load all the new pages you click on from the parent page. Heh, i sound as confusing as ever :D ... here's the code, let me know if this is what you want, or how you want to go around this:

within your <head> tags put:

<script>

function openUp(){
window.open('blank.html','abcd','');
window.focus();
}

</script>

(note, the third set of single quotes, you can put in the window attributes = best place to understand about these window attributes, at least where i learned them from, was webmonkey).

abcd -> the name of the window that pops up
window.focus -> makes sure that the current window stays on top.

in your <Body> tag include:

onload="openUp()"

whenever you call in a link, you can either create an array, or you can just create a link and within the <A HREF> tag, include

TARGET="abcd" or whatever you called the new window.

Let me know if this is what you want. Unfortunately, I don't know what you mean by "containerless"
Duniyadnd

whackaxe
08-13-2002, 11:16 AM
if by containerless you mean with no border or windoze titlebar then take a look a www.dynamicdrive.com and look for the cromles window script

duniyadnd
08-13-2002, 11:20 AM
Okay, found a containerless page, and found an example, here's the direct code from that page, put it within your head tags

***************
<script>

// Amazing Frameless Popup Window - Version I
// (C) 2000 www.CodeLifter.com
// Free for all users, but leave in this header

// set the popup window width and height

var windowW=300 // wide
var windowH=400 // high

// set the screen position where the popup should appear

// var windowX = 200 // from left
// var windowY = 300 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);

// set the url of the page to show in the popup

var urlPop = "mypopup.htm"

// set the title of the page

var title = "Bill says hello to you"

// set this to true if the popup should close
// upon leaving the launching page; else, false

var autoclose = true

// ============================
// do not edit below this line
// ============================

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openFrameless(){
if (beIE){
NFW = window.open("","popFrameless","fullscreen,"+s)
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
NFW.document.open();
NFW.document.write(frameString)
NFW.document.close()
} else {
NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
}
NFW.focus()
if (autoclose){
window.onunload = function(){NFW.close()}
}
}

</script>

************

Credit goes to: http://www.billstruhar.com/experiments/container.htm

And while i was typing this, yeah the post above came up, forgot about dynamicdrive, might have been even a better bet. :thumbsup: Try them both.

Duniyadnd

piniyini
08-13-2002, 11:28 AM
The url of the containerless window is http://codelifter.com/main/javascript/amazinggobehind.html

piniyini
08-13-2002, 11:31 AM
hate when that happens