PDA

View Full Version : Window Widget hide close button, close with esc



twright6
03-01-2012, 04:51 AM
Window Widget

http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm

I need to customize the script in two ways.

First I will be using the script in two different ways on the same page. I need to use it as a mouseover popup in which case I do not want to display the close button. The other method will be as a modal in which case I need the close button. Is there an easy way to hide the close button based on my usage?

Second I would like an idea of how to close the modal version when the escape key is pressed?

c1lonewolf
03-01-2012, 07:11 PM
1. You would need to create a new function within the file itself that will be called using an onmouseover event. It accesses the className='Close' and change display from display:; to display:none;

2. Capture keyboard 'Escape' keydown event and return objectName.Close()

twright6
03-03-2012, 01:07 AM
I understand the concept on #2, however your solution for causing the close button to disappear I am not following (#1), can I ask for more detail?

twright6
03-03-2012, 03:00 PM
I finally got a handle on your idea, but since I use the ajax method of populating the content area, there was always a flash of the close button while the content was being fetched. I wound up modifying the script to accept another attribute I called 'close' and when it equals 1 then the script creates the 'drag-control' div complete with buttons, when it is 0 it produces the 'drag-control' div with no buttons. Thank you for your suggestion. I believe I am now on the way to making use of the same script via mouseover and modal mode.