PDA

View Full Version : link pop-up?


Neo
10-30-2001, 11:42 PM
does anyone know how to make a like that when it is clicked it will open a new window and close itself?

nandastone
10-31-2001, 04:15 AM
I think you need to explain further, I'm not really sure what you are saying. Do you mean have a link that, when clicked, close the current window and pops up a new one?

silence
10-31-2001, 04:30 AM
Sure go get a javascript pop up script. Then find the template that the link is in that you want to have pop up. Add the needed code there, and then add the rest in the header as whatever the script says.

MrLister
10-31-2001, 02:05 PM
i'm sure there's a way in javascript. search for something similar inside google.com

eva2000
10-31-2001, 02:07 PM
yup google.com and alltheweb.com search ;)

JamesUS
10-31-2001, 05:20 PM
Try this: (not tested, and probably won't work) :D


<a href="whatever.com" target="_blank" onClick="javascript:window.close()">


But remove the space between java and script; vB adds a space automatically to stop any scripts being executed.

MrLister
11-01-2001, 12:57 AM
post here if it works... i want to see if it worked... i could probably use this also.

Neo
11-05-2001, 01:51 AM
put java & script together and it works

Aman
11-07-2001, 08:18 PM
Hello Neo! I am very much hoping your request is for what I am thinking it is. Anyway, hopefully I will be able to help.

Try this:
In the head section:
<STYLE TYPE="text/css">
<!--
BODY {OVERFLOW:scroll;OVERFLOW-X:hidden}
.DEK {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;}
//-->
</STYLE>



In the body section:

<DIV ID="dek" CLASS="dek"></DIV>

<SCRIPT TYPE="text/javascript">
<!--

Xoffset=-60; // modify these values to ...
Yoffset= 20; // change the popup position.

var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appName=="Netscape"){(document.layers)?nav=true:old=true;}

if(!old){
var skn=(nav)?document.dek:dek.style;
if(nav)document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=get_mouse;
}

function popup(msg,bak){
var content="<TABLE WIDTH=150 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
if(old){alert(msg);return;}
else{yyy=Yoffset;
if(nav){skn.document.write(content);skn.document.c lose();skn.visibility="visible"}
if(iex){document.all("dek").innerHTML=content;skn.visibility="visible"}
}
}

function get_mouse(e){
var x=(nav)?e.pageX:event.x+document.body.scrollLeft;s kn.left=x+Xoffset;
var y=(nav)?e.pageY:event.y+document.body.scrollTop;sk n.top=y+yyy;
}

function kill(){
if(!old){yyy=-1000;skn.visibility="hidden";}
}

//-->
</SCRIPT>

And finally this into your link tag:
ONMOUSEOVER="popup('Text goes here','00FFFF')"; ONMOUSEOUT="kill()"