Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Trying to follow a script from this site.

  1. #1
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default Trying to follow a script from this site.

    I have installed the scrip as per link below and works ok but need some advice.
    When i place my mouse over the photo it shakes like it is supposed to but upon moving the mouse on & off the photo at different angles the shake is either ok or fast or very fast.
    I am lost as to how to get it the same speed.

    http://www.dynamicdrive.com/dynamicindex4/shake.htm

    Thanks for any advice given.

  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

    Some might call that a feature.

    For more consistent performance, use this slightly modified version:

    Code:
    <script type="text/javascript">
    
    /*
    Shake image script (onMouseover)- 
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    //configure shake degree (where larger # equals greater shake)
    var rector=3
    
    ///////DONE EDITTING///////////
    var stopit=0 
    var a=1
    
    function init(which){
    stopit=0
    shake=which
    shake.style.left=0
    shake.style.top=0
    }
    
    function rattleimage(){
    clearTimeout(rattleimage.timer);
    if ((!document.all&&!document.getElementById)||stopit==1)
    return
    if (a==1){
    shake.style.top=parseInt(shake.style.top)+rector+"px"
    }
    else if (a==2){
    shake.style.left=parseInt(shake.style.left)+rector+"px"
    }
    else if (a==3){
    shake.style.top=parseInt(shake.style.top)-rector+"px"
    }
    else{
    shake.style.left=parseInt(shake.style.left)-rector+"px"
    }
    if (a<4)
    a++
    else
    a=1
    rattleimage.timer = setTimeout("rattleimage()",50)
    }
    
    function stoprattle(which){
    stopit=1
    which.style.left=0
    which.style.top=0
    }
    
    </script>
    - John
    ________________________

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

  3. #3
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Ok i will look thanks
    Last edited by theremotedr; 08-01-2012 at 08:36 AM.

  4. #4
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Thanks for the advice.
    Somehow now i dont get any shake ?
    What did i do wrong,could you look at the page in question and possibly advise.

    http://www.ianparsons.info/zyx.htm

  5. #5
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    HI
    I have just put the original code in and it shakes.
    I then removed the original & replaced it with the above then no shake ?

  6. #6
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    I have now removed the script as i could not sort it out so having to think of another script to use,thanks

  7. #7
    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

    That seems perhaps a bit impatient. Perhaps one of us made a typo. I tested it and it works:

    http://home.comcast.net/~jscheuer1/side/shake/shake.htm

    You can use your browser's "View Source" to get the working code. Or if there is a problem with the above demo, perhaps it's browser specific. In that case which browser are you using?

    If you want me to fix your implementation, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  8. #8
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Sorry about that,didnt mean to upset anyone.
    I have come away from that idea now and just using the photos.

    Thanks for the reply anyhow.

  9. #9
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    In my inbox today was an email to say that there was a reply to this thread by "username" but when i look i see no reply from that person ?

    Any advice.

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It was a spam message, unrelated to your topic. (It has now been deleted.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •