PDA

View Full Version : DHTML Window Widget open on click only



Sherlock
08-10-2010, 02:06 PM
1) Script Title: DHTML Window Widget

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem: Great script. I am trying to set it up so that it only opens the window when a link is clicked, not on page load. My knowledge of script editing is very limited !

Thanks

ddadmin
08-10-2010, 07:22 PM
If you look at demo 3 (http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/demo.htm) on the script page, it is opened via a link, and not automatically. Instead of calling dhtmlwindow.open() directly, simply wrap it in a function, and call it onClick inside the link. For example:


<script>
function openwindow(){
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://images.google.com/", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
}
</script>

<a href="#" onClick="openwindow(); return false">Create/ Open Window</a>