Results 1 to 4 of 4

Thread: onMouseover effect help.

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

    Default onMouseover effect help.

    Hello I am trying to make my whole webpage shake when i have my mouse go over a picture on that page. The only scripts i could find were for effects that would just shake the picture and not the whole page. Could someone please help me out with getting the whole page to shake?

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi there.
    [please post in the correct forum section-thanks]

    Pop this in your HEAD section:

    Code:
    <script language="JavaScript1.2">
    function shake() {
    if (parent.moveBy) {
    for (i = 15; i > 0; i--) {
    for (j = 2; j > 0; j--) {
    parent.moveBy(0,i);
    parent.moveBy(i,0);
    parent.moveBy(0,-i);
    parent.moveBy(-i,0);
    }
    }
    }
    }
    </script>
    And on your pictures, make the <img src="file.jpg"> tag look like this:
    Code:
    <img src="file.jpg" onmouseover="shake()">
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

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

    Default

    oops sorry im new to these forums. where should I have posted this? also i input the code you listed and it wouldnt work. Do i need to edit anything other than the name of the img file?

  4. #4
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, I'll break it down for you.

    The first chunk of code goes inbetween these two tags: <head> and </head> in the actual HTML code (Code view if you're using FrontPage).

    Then, find your image tags in the HTML. They always start with <img, and when you find one of these, just before the closing >, insert onmouseover="shake()".

    cr3ative
    Don't worry about where to post too much, but this would have been better in the Javascript section
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

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
  •