Results 1 to 6 of 6

Thread: Help with Browser Earthquake script

  1. #1
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with Browser Earthquake script

    This message is in respect to the Browser Earthquake script found at URL http://www.dynamicdrive.com/dynamici...earthquake.htm

    I am using this script as a fun attention getter on my website's Earthquake Data RSS listing service from the USGS. (my page is at http://www.christiangeology.com/news/earthquakes.php)

    The screen shakes, as it is supposed to, but the popup message appears to be popping up down below the cut of the browser window. Consequently, the visitors are not seeing the popup. What (if anything) can be done to force the popup to appear in the visable portion of the screen?

    I noted that there is a subroutine in the code to "//position quake message in center of screen" but, being a total neophite to this type of coding, I have NO IDEA what needs to be changed or added to accomplish the desired result. I would greatly appreciate some sage advice.
    Thank you.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This is rather an old script. It should be updated to be compatible with newer browsers but, to simply get it to work on your page using your doctype and IE as a browser, change these two lines in the code:

    Code:
    quakemsg_ie.style.left=document.body.scrollLeft+document.body.clientWidth/2-quakemsg_ie.offsetWidth/2
    quakemsg_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-quakemsg_ie.offsetHeight/2
    to:

    Code:
    quakemsg_ie.style.left=document.body.scrollLeft+document.documentElement.clientWidth/2-quakemsg_ie.offsetWidth/2
    quakemsg_ie.style.top=document.body.scrollTop+document.documentElement.clientHeight/2-quakemsg_ie.offsetHeight/2
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,
    Thank you so very, very much for the prompt reply and the fix. Worked like a charm.

    I can relate to this older script/new browser problem. I had been using another script on my site to popup a small window with on a mouseover of a page graphic for looking up Hebrew and Greek definitions on some of my other pages. It still works for older browsers, but Microsoft's change to sp2 ruined that function. Now all I get is a javascript()void and a click, with an error on page prompt. An example is on this page http://www.christiangeology.com/gap_theory.html
    Put a mouse over the green Hebrew graphics that are inserted into the Bible verse just below the big graphic at the start of the page. When it works a new window popsup with a definition for the word. Any suggestions on how to update this js would also be appreciated.

    But again, thank you for solving my more immediate problem.
    Gaines

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I could not duplicate the problem. I did however, receive a warning about pop-ups that I had to respond to with 'temporarily allow' before it would work. I use a similar script on some pages I master and have never seen this behavior (pop-up warning). I'd suggest trying these changes to the in page part of the code, currently:
    Code:
    onMouseOver="JavaScript: newWindow = openWin( 'strongs/g1597.html', 'POPUP', 'width=450,height=170,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,screenX=0,left=0,screenY=0,top=0' ); newWindow.focus()"
    to:
    Code:
    onMouseOver="JavaScript: newWindow = openWin( 'strongs/g1597.html', 'pwin', 'width=450,height=170,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,screenX=0,left=0,screenY=0,top=0' ); return true;"
    though I am not certain this will fix it or even get rid of the 'allow pop-ups?' prompt. It may even mess things up so, backup your page first.

    On another note. I've updated the earthquake script, my new version is in the Bug Reports forum here. It works in IE4+ NS4.79+ and FF.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I was thinking, off and on, about your page with the pop-up windows and thought you might want to upgrade to this script:

    Cool DHTML Tooltip

    The tips can be configured for size and appearance. They do not rely upon creating a new window and can appear right at the spot on the page each is needed.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Earthquake Script Update

    I've updated the earthquake script, my new version is in the Bug Reports forum here. It works in IE4+ NS4.79+ and FF.
    John,
    Thank you very much for posting the update. I have updated the script on my earthquakes page and it does appear to work very well, especially with the newer browsers. It really looks good in Mozilla now!

    Thank you so much for your effort.
    Gaines
    PS: Sorry it took so long to respond, but I had to go back to the States for a funeral and just got back to Germany yesterday.

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
  •