Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Close event DHTML window interferes with DHTML tooltip II?

  1. #1
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Close event DHTML window interferes with DHTML tooltip II?

    1) Script Title: DHTML window

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

    3) Describe problem:
    When the script is used in combination with the DHTML Tooltip II script a problem occures when someone use the close button on the DHTML window. This wont occure if the hide event is used.
    For some reason this close event clears the DHTML Tooltip II (they wont popup anymore)
    Is it possible to add a hide event to this close button instead?

    Regards,

    Emile
    Last edited by Emile; 06-18-2007 at 10:17 AM.

  2. #2
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    More information:

    The same problem occures when you drag the window.
    If you drag the DHTML window the DTHML tooltip stops working.
    These are the tooltips on the underlying window so not tooltips you use in the DHTML window.

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

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

  4. #4
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hopefully you will have a bit of understanding dutch.

    You can find the website here: http://www.koster.nl/reken/generali/generali.asp

    You have to check the checkbox with the label "Inboedelverzekering"

    Here you will see small icons with an "i" on it and you can hoover over them for the DHTML Tooltip II (those tooltips are really great, I even store complete tables in those and show pictures).

    If you use the button with the label "Klik voor rekenhulp" you will get the DHTML Window.

    Now 2 items will trigger that the popups wont work anymore and that is the close icon on the DHTML Window and if you drag the DHTML Window.
    If you use the normal buttons (which call the hide function) the icons will still work when you return to the main window.

    So for test purpose first try the normal buttons which call the hide function and you will notice that the DHTML Tooltips still work.
    After that try the drag and/or closebutton (right top corner of DHTML Window) and you will see that the icons stopped working.
    I even don't get a JavaScript error (or at least my debugger wont show anything wrong).
    The rest of my JavaScripts are still working properly.

    Hope this will provide enough information for your investigation.


    Regards,

    Emile
    Last edited by Emile; 06-19-2007 at 07:16 AM.

  5. #5
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I found something interesting which explains the drag and close problem.

    The DHTL Tooltip event -> document.onmousemove=positiontip is replaced with the DHTML Window event when dragging the DHTML Window.
    Further the document.onmousemove is set to null in the stop function (which also is triggered by the close button).

    Is there a possebility to store a previous set onmousemove event so this one can be restored when you leave the DHTML Window?

    My temporary fix for the drag problem is resetting the DHTML Tooltip onmousemove event in the onclose function (in my script not the dhtlwindow.js) of the DHTML Window.
    This still doesn't fix the close button problem as that one is not triggering the onclose function.

  6. #6
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Testing further.

    I also used DHTML Tooltips in the same DHTML Window (mind here that even without use of DHTML Tooltips in this window the problem on the underlying window occures).
    When I drag the DHTML Window for some reason these tooltips still work properly, even as the stop function is called every time you stop dragging which set onmousemove event to null.

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I'm going to take a closer look at this later today (it's very late now).

  8. #8
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sorry for the delay in response. This may or may not work, as I couldn't test everything with some files being on your server. But inside modal.js, find the lines:

    Code:
    		if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed
    			this.interVeil.style.display="none"
    And change that to:

    Code:
    		if (this.veilstack==0){ //if this is the only modal window visible on the screen, and being closed
    			this.interVeil.style.display="none"
    			this.interVeil.style.left="-1500px"
    			this.interVeil.style.top="-1500px"
    		}
    It seems on your page, for some reason, just hiding the veil isn't enough. The new code also moves it out of the screen.

  9. #9
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried above solution but it didn't fix my problem.

    The problem lies in that the onmousemove event is set to null (for some reason on the underlying window, as it doesn't occure on the DHTML Window itself).
    Is there any way that you can store the previous onmousemove event and restore that when you close the DHTML Window?

    The workarround for the drag problem is that I reset the onmousemove event in the onclose function of the DHTL Window.

    Code:
    function openInboedelBereken() {
        inboedelBerekenWin=dhtmlmodal.open('InboedelWindow', 'iframe', 'generali_bereken_inboedel.asp', 'Bereken de inboedelwaarde', "width=720px,height=480px,center=1,resize=0,scrolling=0", "recal")
        inboedelBerekenWin.onclose=function() {
     
            ... my code here ...
            
            document.onmousemove=positiontip
            
            return true;
        }
    }
    But the close event if you click right top icon isn't triggering this function so the workarround is not working for that.
    Last edited by Emile; 06-21-2007 at 10:51 AM.

  10. #10
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I made a fix for myself, I changed the following to the modal.js:

    I made a global variable:
    Code:
    var onMouseMoveEvent
    I stored the onmousemove event in this variabale in the open function
    Code:
    open:function(t, contenttype, contentsource, title, attr, recalonload){
    	onMouseMoveEvent = document.onmousemove // store previous onmousemove event
    	var d=dhtmlwindow //reference dhtmlwindow object
    ... rest if the function code
    And I restore the onmousemove event at the close and forceclose functions
    Code:
    close:function(t){ //user initiated function used to close modal window
    	t.contentDoc=(t.contentarea.datatype=="iframe")? window.frames["_iframe-"+t.id].document : t.contentarea //return reference to modal window DIV (or document object in the case of iframe
    	var closewinbol=dhtmlwindow.close(t)
    	if (closewinbol){ //if var returns true
    		this.veilstack--
    		if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed
    			this.interVeil.style.display="none"
    	document.onmousemove=onMouseMoveEvent // restore previous onmousemove event
            }
    },
    
    forceclose:function(t){ //function attached to default "close" icon of window to bypass "onclose" event, and just close window
    	dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing
    	t.style.display="none"
    	this.veilstack--
    		if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed
    			this.interVeil.style.display="none"
    	document.onmousemove=onMouseMoveEvent // restore previous onmousemove event
    },
    This works fine and solves all my problems.

    (cleared all my typos *sighs*)
    Last edited by Emile; 06-21-2007 at 02:22 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •