PDA

View Full Version : Opening a Link to vBchat in a New Smaller window


oglsmm
15 Apr 2005, 19:21
I have a link to my vBchat section on a seperate page. How do I make this link open up the chat into a seperate smaller window, instead of the full screen one it does by default.

Sarizaddi
21 Apr 2005, 16:13
In your Admin Templates, you changed a few, one of them being "navbar". Go back into your control panel, Styles & Templates, Style Manager, select "Edit Templates", expand all "[<< >>]", go back to modify the "navbar" template.

The code you added should've been:

<script type="text/javascript">
<!--

function OpenvBChat(){
vBChat = window.open('vBChat.php?$session[sessionurl]','vBChat','directories=no,height='+window.screen.height+',width='+window.screen .width+',location=no,menubar=no,scrollbars=yes,status=no,toolbar=no')

return false;
}

-->
</script>
<td class="vbmenu_control"><a href="vBChat.php?$session[sessionurl]" onclick="return OpenvBChat();">vBChat</a></td>


take that out and substitute instead:

<script type="text/javascript">
<!--

function OpenvBChat(){

var ws = screen.width*0.85;
var hs = screen.height*0.7;
var winParms = "height=" + hs + ",width=" + ws + "directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resiza ble";
vBChat = window.open('vBChat.php?$session[sessionurl]','vBChat',winParms)

return false;
}

-->
</script>
<td class="vbmenu_control"><a href="vBChat.php?$session[sessionurl]"

In the above, you will see "var ws = screen.width*0.85;" and "var hs = screen.height*0.7;" In there, Screen Width is a percentage, currently being 85% of the user's screen. Same with Height, at 70%. You can manually adjust these, like if you wanted 90% and 90% you'd use .9 and .9

Doing this will not only allow it to pop up in a smaller window, but will also allow it to be user resizable.

Please note in the snippet, the forum is adding a space in resizable, making it "resiza ble" I can not correct that in my post, but it needs to be corrected before you insert it in the navbar template.

oglsmm
25 Apr 2005, 15:06
Thank You!

greenhybrid
25 Apr 2005, 21:37
Or, you can just make it open in a new window/tab by taking out the javascript and replacing the onclick function with target="_blank" in the links to it.