Results 1 to 3 of 3

Thread: dhtmlwindows hooks

  1. #1
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dhtmlwindows hooks

    1) Script Title: dhtmlwindows

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

    3) Describe problem: I am looking for a way to track the dhtmlwindows that are open. I've been tryin' many different ways, but just haven't locate a hook that I can use to do so.
    I am not looking at the information to be stored remotely, just during the user's present session.

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

    Default

    Each instance of DHTML window defined on your page is stored inside the array dhtmlwindow.tobjects[]. Following the same logic as how to close any previously opened DHTML windows before opening the present, the below code when run tells you the IDs of the currently opened windows on the page:

    Code:
    <script type="text/javascript">
    
    function getopenedwindows(){
    	for (var i=0; i<dhtmlwindow.tobjects.length; i++){
    		if (dhtmlwindow.tobjects[i].style.display=="block")
    		alert(dhtmlwindow.tobjects[i].id)
    	}
    }
    
    </script>
    
    <a href="#" onClick="getopenedwindows()">Test</a>
    DD Admin

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Thank you! That was the info I needed!

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
  •