Simple Pop-up Window
I tend to use this little bit of javascript quite a bit so I thought I would share. You can use this little javascript to add a "Pop-up" window effect to links in your website.
For example, if you have a page of product images and Item numbers you can make them link to a "Pop-up" window with the item details.
Making a lot of these pages can be very cumbersome so I suggest automating the page creation by pulling the item detail from a database. This can be achieved very simply by running a Cold Fusion Query... I'll talk about that later.. But, for now here is the Javascript: Place this first bit of code in the head of the document that will be calling the new window.
<script LANGUAGE="JavaScript">
<!--
function pop(url)
{
window.open(url,'profile','width=450,height=500,scrollbars,resizable');
}
function printWindow(){
version = parseInt(navigator.appVersion)
if (version >= 4) window.print()
}
//-->
</script>
- channelmode - Specifies if window should be opened in channel mode. IE only.
- fullscreen - Specifies if window should be opened in full screen mode. IE only.
- height - Specifies the height of the window.
- left - Specifies the x coordinates of the window in pixels. IE only.
- location - Specifies if the location bar of the window should be included.
- menubar - Specifies if the menu bar of the window should be included.
- resizable - Specifies if window should be resizable.
- screenX - Specifies the x coordinates of the window in pixels. NS only.
- screenY - Specifies the y coordinates of the window in pixels. NS only. See "top" as well.
- scrollbars - Specifies if window should contain scrollbars.
- status - Specifies if the status bar of the window should be included.
- toolbar - Specifies if the toolbar of the window (ie: reload button) should be included.
- top - Specifies the y coordinates of the window in pixels. IE only.
- width - Specifies the width of the window.
<a href="javascript:pop('detail.cfm')">Click here for more information.</a>



Nice bit of JS, This is really useful. I am looking forward to seeing how you handle the query for window content. My current project has a requirement for a rollover event which displays an information popup. I think this snip would work nice for this with the event handler in place.
D.