Web Hosting Talk







View Full Version : How the heck do I do this?


WWH-David
03-05-2003, 04:41 AM
Hello all, :smash:

I hope this is the right forum to be discussing web design issues; if not, I apologize. After hours of trying, I am stumped! I have a script that someone gave me here - it creates a rollover image that results in a mini-browser opening up with the new page in it. This new browser is not sizeable, nor does it have toolbars.

Anyway, I am trying to put a link in this new pop-up window that will go to another full sized page, however I want it to open in the original browser window that opened the pop-up. Using target=_blank, I was able to get it to open in a new window, which is ok if I have to. All of the other target tags I know try to open the new page in the little mini pop-up window. Preferably, I would like the user to click the link in the pop-up window, then that window closes and the original browser goes to the link.

Does this make any sense at all? I must be losing my mind! :puke: So, if anyone would know how I can do this, I would very much appreciate some advice.

I would like to say thanks in advance for any feedback here!


Here are the scripts:

Between the header and body of the main page:

Between the header and body:


<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<script type="text/javascript">
<!--
function awindow(url){
return window.open (url, "thewindow", "toolbar=no,width=500,height=350,status=no,scrollbars=no,resize=no,menubar=no");
}
-->
</script>



To call the script (create a pop-up mini-window):

<a href="30day_pop-up.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('30day','','images/roll/index_11_over.jpg',1)"><img name="30day" border="0" src="images/index_11.jpg" width="119" height="54" target="_blank" onClick=
"awindow('30day_pop-up.html');return false"></a>

The link in the pop-up window :
(this is the link that I would like to close the pop-up (if possible) while opening the link in the original browser window - this way, the user wont have 3 windows open)

<a href="signup.html" target="_blank"><font color="#006633">sign
up</font></a>



Whew! If you have read this far, thanks!

Best regards,
David Harris
WorldWideHosting.net

DigiCrime
03-05-2003, 05:01 AM
edit.... read it wrong

Anyway, I am trying to put a link in this new pop-up window that will go to another full sized page, however I want it to open in the original browser window that opened the pop-up

you need to setup targets. so your a href opens where you set the target to open... "signup.html" target="whatever the target name is" i believe thats how you do it, similar how you do frames, when you click the link it knows what frame to open it in...cept i forgot how

WWH-David
03-05-2003, 05:14 AM
Thanks for the reply, DIGI!

Yeah, I figured it was something like that - I tried _parent, _self, _blank and _blank is the only one that seems to work right. I would think parent would put me back there, but it opens the page in the tiny pop-up window!

Oh well, more coffee! Anyone think I am nuts, or is it just me?

Thanks!

DigiCrime
03-05-2003, 05:27 AM
could always check/ask over at sitepointforums.com/net whichever it is, if you dont find an answer here :)

Reptilian Feline
03-05-2003, 06:00 AM
Let me do some checking... will give possible answer, promice :)

Reptilian Feline
03-05-2003, 06:48 AM
I can do it with frames, but not without. I think you need some more java for it.