Javscript in a frame which shakes the browser/windows ( called also earthquake) have problem with I

Discussion in 'Javascript' started by francisco lopez, Jan 4, 2005.

  1. hallo,

    I Have the following problem:

    I want to shake (earthquake-effect) the browser when someone hits the
    button.
    So I used the following script:

    -----------------------------------------------------------------
    between <head></head>:

    <script language="JavaScript">
    function shake(n) {
    if (top.moveBy) {
    for (i = 15; i > 0; i--) {
    for (j = n; j > 0; j--) {
    top.moveBy(0,i);
    top.moveBy(i,0);
    top.moveBy(0,-i);
    top.moveBy(-i,0);
    }}}
    alert("a que jode eh, mamón! a ver si la próxima vez nos comportamos
    en el cine!");}
    </script>

    and in the <body></body>:

    <img src="buttonend1.jpg" name="Image23" width="50" height="53"
    border="0" value="Earthquake!" onClick="shake(15)">
    ---------------------------------------------------------
    the button is situated in a frame.

    I WORKS 100% with Firefox but the shake-effect doesn´t work with
    Internet Explorer, only if I open the frame as a single side than it
    works also wit IE.
    So I tried to rename every "top.moveBy" to "parent.moveBy) and it
    still doesn´t work.
    Where is the mistake? What do I wrong?
    Was it the correct way to call the parent Frame?

    hope you can help me would be grate if it works,

    regards

    Francisco.

    pd:

    I have read that the "earthquake-effect" can harm the computer? but I
    read also that it is impossible to harm the computer with this
    javascript?
    So what is now true?
     
    francisco lopez, Jan 4, 2005
    #1
    1. Advertisements

  2. On 3 Jan 2005 16:19:34 -0800, francisco lopez <> wrote:

    [snip]

    > I have read that the "earthquake-effect" can harm the computer?


    It won't harm the computer, but it certainly will confuse or annoy users.
    For that reason alone you shouldn't use it.

    By the way, frames are another thing that should generally be avoided.

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Jan 4, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tomas
    Replies:
    1
    Views:
    3,456
    Teemu Keiski
    Feb 8, 2004
  2. Ben
    Replies:
    2
    Views:
    557
    Thomas Weidenfeller
    Mar 20, 2006
  3. S_K
    Replies:
    6
    Views:
    1,567
    Robert Dunlop
    Nov 8, 2007
  4. Mark Sullivan
    Replies:
    0
    Views:
    352
    Mark Sullivan
    Dec 21, 2007
  5. Mark Sullivan
    Replies:
    0
    Views:
    347
    Mark Sullivan
    Dec 21, 2007
  6. Adam Akhtar
    Replies:
    2
    Views:
    160
    Caleb Clausen
    Mar 7, 2010
  7. Dmitry
    Replies:
    2
    Views:
    135
    Dmitry
    Feb 27, 2005
  8. Marc Aymerich
    Replies:
    11
    Views:
    379
    Steven D'Aprano
    Nov 23, 2012
Loading...