|
Author |
Message |
Gary
Junior WebHelper
Joined: 30 Apr 2003
Posts: 21
Location: the UK, Devon
|
Posted:
Wed Mar 03, 2004 11:18 pm (20 years, 10 months ago) |
|
Hey all, i want this code to open a window of a certain size... so i was told to do this:
Quote: | <SCRIPT language=JavaScript>
<!--
function click()
{
window.open("http://www.dontstop.co.uk/v2/atb/html_files/lyrics-music-inlovewiththedj.htm","click1","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width=550,height=500");
}
//-->
<!--
function click()
{
window.open("http://www.dontstop.co.uk/v2/atb/html_files/lyrics-melodies-9pmtillicome[134].htm","click2","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width=550,height=136");
}
//-->
<!--
function click()
{
window.open("http://www.dontstop.co.uk/v2/atb/html_files/lyrics-melodies-dontstop[134].htm","click3","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width=550,height=136");
}
//-->
</SCRIPT> |
great, i link as javascript:click(1); javascript:click(2); javascript:click(3); and so on, but the problem is - the same window ALWAYS opens... same size and everything??? what am i doing wrong? please help |
|
|
|
|
php4ever
Junior WebHelper
Joined: 10 Oct 2002
Posts: 49
|
Posted:
Thu Mar 04, 2004 3:40 am (20 years, 10 months ago) |
|
The function just needed a little tweaking so here's the revised code and it works. Put the following javascript in the HEAD section or alternatively at the end of the BODY -- your choice.
<SCRIPT LANGUAGE="JavaScript">
<!--
function click(num)
{
var features = "width=550,height=136,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no";
var theurl = "";
var hostetc = "http://www.dontstop.co.uk/v2/atb/html_files";
var thepath = new Array(3);
thepath[0] = "/lyrics-music-inlovewiththedj.htm";
thepath[1] = "/lyrics-melodies-9pmtillicome[134].htm";
thepath[2] = "/lyrics-melodies-dontstop[134].htm";
num--; // adjust num so will index into array properly
theurl = hostetc + thepath[num];
window.open(theurl,"nuwin",features);
}
//-->
</script>
Then in the BODY section you would call the function like this:
<a href="javascript: click(1);">click 1</a><BR>
<a href="javascript: click(2);">click 2</a><br>
<a href="javascript: click(3);">click 3</a><br>
Hope this helps. |
|
|
|
|
Gary
Junior WebHelper
Joined: 30 Apr 2003
Posts: 21
Location: the UK, Devon
|
Posted:
Thu Mar 04, 2004 9:03 pm (20 years, 10 months ago) |
|
you guys are geniuses!!!
cheers guys!!! |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.138283 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
|