Results 1 to 3 of 3

Thread: DHTML Window widget (v1.1): How to <body onload... IE 6/7

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

    Default DHTML Window widget (v1.1): How to <body onload... IE 6/7

    1) Script Title: DHTML Window widget (v1.1)

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

    3) Describe problem: I added Window Widget to my page. I want to call the script onload, so I added this to the body tag:

    <body onLoad="divwin=dhtmlwindow.open('divbox', 'div', 'somediv', 'Strongid Shine Wellness Package', 'width=360px,height=460px,center=1 ,resize=1,scrolling=1')">

    It works in Firefox; the hidden div pops up when window loads. But in Windows IE 6 or 7 the hidden div does not pop up. There are no js errors.

    Is there a way to make it work in IE 6/7?

    Thanks

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

    Default

    Hmm there's no reason why it wouldn't work in IE. Using the first demo in the zip file as an example, this works for me in IE6:

    Code:
    <body onLoad='googlewin=dhtmlwindow.open("googlebox", "iframe", "http://images.google.com/", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")'>
    However, to make the above more unobtrusive, you can call dhtmlwindow.addEvent() to call the desired function on window load:

    Code:
    dhtmlwindow.addEvent(window, function(){
    	googlewin=dhtmlwindow.open("googlebox", "iframe", "http://images.google.com/", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
    }, "load")
    DD Admin

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

    Default RE: DHTML Window widget (v1.1): How to <body onload... IE 6/7

    Hi,

    Thanks for the quick response. For some reason, I cannot the <body onload= to work in IE 6 or 7, but works fine in Firefox/Safari. (Of course, your example uses an external web page where my example is using a hidden div in the current page)

    However, I DID get the onload function you created to work; dhtmlwindow.addEvent()

    Thanks a LOT for your help.

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
  •