Forum Moderators: open

Message Too Old, No Replies

Pop up advertisment

         

yllai

9:21 am on Apr 15, 2004 (gmt 0)

10+ Year Member



Let said, I have an advertisment or image, I want it to be pop up after user click on the hyperlink in my page. The pop up box just have the image or advertisment, no menu bar like what we have with browser such as File, Edit....except the minimize, maximize and close option.
How can I do it? Where I can get these info? Is it possible? What programming language I can use?

Thanks.

Sanenet

9:30 am on Apr 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to use javascript. Look in Google for javascript sites, there are loads of them offering free scripts.

Rambo Tribble

1:21 pm on Apr 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's something to play with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Playing with Windows 04.14.04</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
var win_num=new Array();
var win_cnt=0;
function winBld(){
var stack_xy=win_cnt*20+50
win_num[win_cnt]=window.open("","win"+win_cnt,"left="+stack_xy+"px,top="+stack_xy+"px,height=200px,width=200px");
win_num[win_cnt].document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'+
'"http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Untitled</title>'+
'<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"></head>'+
'<body><a href="javascript:opener.winBld();">Fire away</a></body></html>');
win_num[win_cnt].document.close();
win_cnt++;
}
function winKill(){
var l=win_num.length;
for(var i=l-1;i>=0;i--)win_num[i].close();
}
//-->
</script>
</head>
<body onunload="winKill();">
<div><a href="javascript:winBld();">Fire one</a></div>
</body>
</html>

sebbothebutcher

3:51 pm on Apr 15, 2004 (gmt 0)

10+ Year Member



how about a script like this?
place it in the head or body tag!
(i don't know wether this makes any difference)

<script type="text/javascript">
function adopen()
{
window.open("yourad.htm", "ad1" , "height=xx, width=yy")
}
</script>

and then the link looks like this:
<a href="yourpage" onClick="adopen()">Click</a>

you can also use an image instead of a html file!
then the window.open would look like this:

window.open("yourad.jpg", "ad1" , "height=xx, width=yy")

a window opened like this will only have the three main buttons (minimize,maximize,close).
for many other properties i'd recommend you search the internet! you could try this page for example! [mozilla.org...]

yllai

1:45 am on Apr 16, 2004 (gmt 0)

10+ Year Member



other then these, do have other method (use other then java script) for me to do this function, because I afraid some browser with user may no support java script.

Rambo Tribble

2:14 am on Apr 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Opening a window requires JavaScript. There are some tricks, however, that allow CSS to do things like drop-down menus, without JavaScript.

yllai

3:08 am on Apr 16, 2004 (gmt 0)

10+ Year Member



I have a lot of images that I will use pop up window to display it...base on the script aforemented, the script for the body of pop up window is belong with the pop up window function(let said function xyz() )...can I just make the script for body of pop up window be not in the function xyz()? that mean the function xyz() is for the format of pop up window, another function abc() is for the body of pop up window..is it can be done? I want to do it because I wish to reuse the function xyz(). Can you give me the example of how to do it?

Thanks.

cwebb

1:07 pm on Apr 16, 2004 (gmt 0)

10+ Year Member



<script type="text/javascript">
function adopen()
{
window.open("popup.htm", "Name_of_popup_indow_doesntreallymatter" , "height=xx, width=yy", location=No,directories=No,status=No,menubar=No,scrollbars=No,toolbar=No)
}
</script>

should do the trick and use the link sebbo mentioned

yllai

2:04 am on Apr 19, 2004 (gmt 0)

10+ Year Member



Now we discuss about pop up an image. How about if I want to pop up a document file (.doc)? Can I do it?

Bernard Marx

6:32 am on Apr 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not try it?

cwebb

10:11 am on Apr 19, 2004 (gmt 0)

10+ Year Member



Easy, just link to the .doc file and it works, at least with common browsers and for users with MS Office installed.