PDA

View Full Version : DHMTL Window Onclick



woodier
07-08-2007, 06:17 PM
1) Script Title: DHTML Window widget (v1.03)

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

3) Describe problem: How is it possible to hide the Div when clicking outside of the Div; e.g. document onclick style.display = 'none'. Using 'divwin.hide' works flawlessly when clicking inside of the Div.

Thanks in advance for your assistance.

jscheuer1
07-08-2007, 08:26 PM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.
(The one you gave is broken)

Please post a link to the page on your site that contains the problematic script so we can check it out.

woodier
07-08-2007, 08:58 PM
jscheuer1,

The incomplete URL was copied from another posting about the DHMTL Window.
My website is in local development, hence there isn't a link to a web page.

woodier

jscheuer1
07-08-2007, 09:20 PM
1) Script Title: DHTML Window widget (v1.03)

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

3) Describe problem: How is it possible to hide the Div when clicking outside of the Div; e.g. document onclick style.display = 'none'. Using 'divwin.hide' works flawlessly when clicking inside of the Div.

Thanks for fixing the link. OK, what division are you talking about? I can put a (for example from the demo):


<a href="#" onclick="inlinewin.hide(); return false">Hide Window 2</a>

anywhere on the page that opened it and it will close it.

If you are trying to close an iframe from within the iframe or any DHTML window from within an(other) iframe (again from the demo):


<a href="#" onclick="parent.googlewin.hide(); return false">Hide Window 1</a>

If you are still having problems, a link to an example of the problem would suffice to diagnose further.

woodier
07-09-2007, 01:38 AM
jscheuer1,

The wording of my request for assistance does not include creating a link to close an Iframe, nor a Div. If you look at the source for Window 4, reference the Script URL, you will find the Div. Clicking outside of the DHMTL Window doesn't hide the Div.

woodier

jscheuer1
07-09-2007, 03:14 AM
This works (as I indicated earlier with another demo DHTML window example) from anywhere on the page:


<a href="#" onclick="divwin.hide(); return false">Hide Window 4</a>

jscheuer1
07-09-2007, 04:03 AM
I'm trying to understand what you are driving at, do you want to close window 4 if the user clicks anywhere on the page, even if it isn't a link?

woodier
08-08-2007, 07:11 PM
Try adding "t.handle.onmouseout=function() {dhtmlwindow.close(this)}" to dhmtlwindow.js. This will give you some idea of what I'm trying to accomplish.:)