View Full Version : Javascript query
PhoenixBB
Sat 8th Jun '02, 10:41am
Hi,
I have some javascripts I want to use - basically click a button and popup window, type thing.
As these will be the buttons in the header would I therefore put the script in the header?
And for those needed on the forum page (some the same) put that in the header of the forumhome file? (I don`t have the header called on the Home page, as it`s slightly different.)
And does anyone know which file I need to alter to change the size of the window that opens when you choose `view in new window` for PMs? It`s way too big on an 800x600 screen.
Thanks.
Dan615
Sun 9th Jun '02, 11:52pm
Um, what? :rolleyes:
andrewpfeifer
Sun 9th Jun '02, 11:58pm
Maybe try www.webmonkey.com, I'm not exactly sure what you're talking about, but they have some great tutorials on a lot of stuff over there.
PhoenixBB
Mon 10th Jun '02, 12:31am
*sigh*
I want to put a link on one of the pages so if you click it it opens a popup window.
I`ve heard somewhere since I posted the above that you don`t allow Javascriipts on the board??
Have a look here http://www.bigbad.net/store/bigbad.htm I`ve got 3 chatlinks at the top. They are not `popup` windows now I resized them in Dreamweaver, I`ll only have one when they`ve chosen their favourite, but I don`t want it there. I want it in one of my forums so only my members have access. Failing that, on the Forum Index page.
So would I put the script in the header if I have the code that calls the Javascript in a forum, or within the head bit of the forum index if I have it just on the index. (the header is not called on the main page)
Geez, even I didn`t understand that! :D
All I want is to have my popup on my board, either on the index or within the forum. Mainly coz I don`t want them bypassing the board and going straight to the chat URL.
Did anyone understand any of that??
Dan615
Mon 10th Jun '02, 2:14pm
<html>
<head>
<script language="JavaScript">
function popup(url, height, width) {
var openWin = window.open(url, "openWin", "height=" + height + ",width=" + width);
}
</script>
</head>
<body onLoad="popup('http://www.thehardwire.com', 500, 500);"> <!-- pop up on load -->
<a href="javascript: popup('http://www.thehardwire.com', 500, 500);">Pop Up Window</a> <!-- or popup on click -->
</body>
</html>
edit: the javascript: popup thing is a bit messed up because of the vbulletin smilies and formatting... (javascript should be one word, not two)
Like that? I didn't test it, I just wrote it down to see if that's what you're looking for...if that's the case, you can put it anywhere you want, but it's smart to put it in the <head> tags...i guess...
PhoenixBB
Mon 10th Jun '02, 3:21pm
Ah I originally had a script like that I think on the old board, but then I thought I couldn`t do it on this, and just did a resized window in DW.
So if I put that script in the <head> bit of the forum page, with an appropriate button or link it`ll be on the Main Page of the board, right?
If I put it in Forum Display Header, it`ll appear on every Forum page won`t it? Is there no way to get it on just one forum page?
As an aside, is there any way to get it so the popup doesn`t actually say on the window where it`s going? Those resized windows I did don`t give the game away, but ordinary popups always seem to. That way they have to use the link on the board, because they won`t know the direct chat url. If you see what I mean. :)
And while I`m here I`ll just say I love, love, love VB! Compared with my old EZboard it loads really fast too. :D
PhoenixBB
Mon 10th Jun '02, 8:04pm
Woohoo, done it!
People didn`t like my mouseover effect, even though I put a lot of space between `em, so I made them plain ole links instead. I put this in the Forumhome <head> bit:
<script>
function openpopup(){
var popurl="http://www.bigbad.net/store/chatroom.htm"
winpops=window.open(popurl,"","width=640,height=420,scrollbars,resizable")
}
function openpopup2(){
var popurl="http://www.bigbad.net/store/chatroom2.htm"
winpops=window.open(popurl,"","width=615,height=355,scrollbars,resizable")
}
function openpopup3(){
var popurl="http://www.bigbad.net/store/chatroom3.htm"
winpops=window.open(popurl,"","width=620,height=420,scrollbars,resizable")
}
</script>
Works a treat. See Big Bad Board (http://www.bigbad.net/thebbb/). :)
vBulletin® v3.8.0 Beta 4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.