TinyPortal

Development => Block Codes => Topic started by: Ianedres on January 01, 2007, 10:57:48 AM

Title: JavaScript Pop-Under Window
Post by: Ianedres on January 01, 2007, 10:57:48 AM
To display a 'pop-under' window and load any HTML file:

In TP, add a new block, using the 'scriptbox' option and inserting this code:

<script type="text/javascript">
var win=window.open("http://www.yourserver.com/correct_path_to/filename.htm",null,"height=275,left=330,location=no,status=no,resizeable=yes")
win.blur()
window.focus()
</script>


Replace the path to the file you wish to load.

I opt not to display any frame/title info in TP's settings, but I do use the title field for reference.

Make sure to turn the block on in TP.

Using different permissions in multiple blocks, you could display various HTML files to each different level; i.e. guests receive a prompt to register, regular users and above get a jukebox in the background... and so forth.

I strongly encourage you to limit your use of the code, as not to annoy your visitors.