View Full Version : javascript pop up question??
ave
September 15th, 2003, 12:10 PM
i have a site which im in process of completeing/redesigning (so its a tad jumbled and not complete) but my prob is this, on the section for each band there is a scrolpane which has a movie in it , which loads into itself another movie containing the small pictures, when clicked they create pop up html pages which have the full size picture on it.
http://www.rakerecords.com
The buttons for the band SNFU work !
but the buttons for mode citizen dont seem to and they have the exact same script on them as the other buttons.
its weird i dont understand it at all, it displays ok on my PC offline but when published it doesnt work.
Im using a fairly simple pop up creater lifted from a tutorial, heres the code:
on (release) {
getURL ("javascript:openNewWindow('new_pop_up.html','thewin ','height=150,width=250,toolbar=no,scrollbars=yes' );");
}The above goes on the buttons (or in this case the small pictures)
<HTML>
<HEAD>
<TITLE>pop_up</TITLE>
<html>
<head>
<title>example</title>
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>
</HEAD>
<BODY bgcolor="#FFFFFF">
<A HREF=JavaScript:(penAuto(\"autochron.html\",\"800\",\"600\")></A></BODY>
</HTML>The above is the html/javascript which goes in the main page
I am not sure why it doesnt work??
Is it maybe something to do with the movie containg the small pics being on a loaded movie which?
any ideas welcome , oh also does anyone know how to make the pop up windows centred on screen and always stay on top ??
kake
September 16th, 2003, 08:19 AM
i think path you are giving is wrong or you forgot to upload pages on server :elderly:
check the following link u're wanting to pop out
http://www.rakerecords.com/Mod2pic.html
404 error
kake
ave
September 16th, 2003, 09:52 AM
hmm wierd it shoudlnt be doing that, ill check it out properly today
cheers:)
ave
September 16th, 2003, 11:31 AM
ok i tried renaming pictures, renaming the html pop up windows, moving them to different folders, and no change still doing the same thing.
I reckon my problem is a more complex one than i can fix here.
I have a theory that that the SNFU works cause it appears first on the timeline where the band pages occur.
maybe the javascript in the HTML isnt affecting the other clips ??
or maybe , well to be honest i have no idea , im stumped please help some one :sigh: !!
if i can fix this i can finish the site :)
kake
September 16th, 2003, 12:21 PM
ave I said the path to that page is wrong because if javascript can't read it it should be read manually atleast for eg.
http://www.rakerecords.com/snfupic2.html
works whereas
http://www.rakerecords.com/Mod2pic.html
doesn't. Are you sure the page is there?If they're there make them accessable incase u've set wrong file permissions :)
kake
j0se
September 16th, 2003, 02:25 PM
hi ave!
if your webserver is a unix-based machine, file names are case sensitive, whereas you might be developing in a local windows environment, where you can get away with inconsistencies in file names case - so check file names for case sensisitity
i'd also try this (just to see if the page is there (in your ftp space):
add the same code to a third button, but add the path to a different (new) pic. then upload the new pic and try it
j0se
September 17th, 2003, 05:04 AM
also this might be quicker/easier
you can use this js in your getURL statement - it's not calling a remote function so you don't have to write any js in a html page)
getURL ("javascript:NewWindow=window.open('http://www.google.com','newWin','width=761,height=421,too lbar=No,location=No,scrollbars=No,status=No,resiza ble=No,fullscreen=No'); NewWindow.focus();");
PS if you try the above locally you'll get a second browser window popping up
ave
September 17th, 2003, 08:32 AM
Tried you code JOse but when i clicked on the button with the code on it my PC froze and hundreds of pop ups were spawning , i had to reboot :*(
I will keep trying with the old one until i know its ok i think , did i use it wrong ??
kake i will look into that , i mean those two links to the relevent pages were revealing , it looks like for some reason the server is not allowing access to those pages or for some reason it wont recognise their name, i will scour the server to see if its fixable, in mean time thanks and any other advice welcome :)
ave
September 17th, 2003, 08:52 AM
Doh !!!
what an idiot , i have fixed it and cant believe how simple it was, im almost annoyed !! :smirk:
I dont quite understand why, but the modpic.html files were not shwoing cause i had a capital M at the begining ??
even though clearly the files were saved with a captial M they only show when i use small caps for their name.
Anyway problem solved cheers guys/gals/whoevers :beam:
One more thing is there any way to specify where the pop up window spawns and a way of making it appear always on top until closed down?
j0se
September 17th, 2003, 11:40 AM
cool to hear you solved it! i've had probs with case sensitivity before, so now i either do all lower case or all caps
the reason for the millions of manic popus and the freeze is because you need to begin your URL with http://
guess how i know? :s:
to position the widow in the top left, add this to the button code:
getURL ("javascript:NewWindow=window.open('http://www.google.com','newWin','width=770,height=446,too lbar=No,location=No,scrollbars=No,status=No,resiza ble=No,fullscreen=No'); NewWindow.focus(); screen_height = window.screen.availHeight; screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-(761/2); top_point = parseInt(screen_height/2)-(421/2); setTimeout('NewWindow.moveTo(left_point,top_point) ',100); void(0);");
that's the original code i posted earlier but with a lot of added voodoo to manipulate the position of the window. if you want to position it anywhere other than top left, your going to have to either play with the settings and go mad, or ask the math guys
:)
ave
September 17th, 2003, 01:26 PM
cheers ill give it a try :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.