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

Thread: DOCTYPE issue with 'Shake Image' Script

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default DOCTYPE issue with 'Shake Image' Script

    1) Script Title: Shake Image Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/shake.htm

    3) Describe problem: Hello! I have installed the 'shake image' script on a site of mine but it does not work when a DOCTYPE is included on the page. It works great without a DOCTYPE (the same as it works - also without DOCTYPE - on DD's page) but it seems that all DOCTYPES stop it from working (I am using Firefox and Safari). Is there a way to fix this issue? Maybe to modify the script so that it will work with a valid DOCTYPE? Thank you in advance!

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

    Default

    Ah yes. I've just updated the script to fix this issue: http://www.dynamicdrive.com/dynamicindex4/shake.htm
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Dyomar (06-03-2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wondering if someone might help me with this aswell?
    I am getting an error message when putting this into my 'Blogger' template- saying the element/type must immediately follow '&' and is not well parsed...? I pasted the code straight from yr page.
    A novice at this stuff, so I'm wondering if there's something I'm missing/not adding, or not doing right?
    Thx heaps- any help with this is appreciated, 'cos it's an awesome looking trick

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

    Default

    Ozrob76, please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  6. #5
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thx heaps for your prompt reply
    That's the thing, I'm not able to save the script into my page, because of the forementioned problem!
    The problem is with the
    if ((!document.all&&!document.getElementById)||stopit==1)
    line apparently...
    The error message reads
    XML error message: The entity name must immediately follow the '&' in the entity reference.
    I've done some looking around, & I think it may be an issue with browser compatibility? (I'm using IE8)
    Last edited by ozrob76; 07-27-2010 at 11:19 PM.

  7. #6
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Um, I'm guessing, now, this is a dumb question

  8. #7
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ghfg

    hello, everybody.

    i know the last post was 2010 and its 2011 now but i need help really bad figuring this out I'm not really good at the HTML codes so please bear with me .

    My Problem: i have a tumblr account and im trying to make my picture's shake on-mouse rollover. but every-time i enter the code it still doesn't work but i know it works because I've seen someone using the exact same theme, and hes profile looks just like mine just with the shaking of the pictures and the color of course.


    between these two codes, i entered the <style> .shakeimage code

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd"> AND

    <!--
    'Heart In A Cage' theme for Tumblr by Fusels (c) 2010
    http://fusels.tumblr.com
    -->

    At the very top of the HTML theme custom

    <style>
    .shakeimage{
    position:relative
    }
    </style>
    <script language="JavaScript1.2">

    /*
    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(){
    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
    setTimeout("rattleimage()",50)
    }

    function stoprattle(which){
    stopit=1
    which.style.left=0
    which.style.top=0
    }

    </script>


    then i paste this code

    <img src="man.gif" class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()">

    right below it and it doesn't do anything at all, so can you please tell me what i am doing that is wrong?



    i have how ever been fooling around with a random theme with image shake and when i paste this code in the theme below </script> at the top the images shake but the profile... everything is messed up and looks terrible Please can someone help me out, it would be very appreciated.

    <div id="center">
    {block:Posts}

    {block:Photo}
    <div class="other"><div style="text-align:right;"><div style="background-color: #F7F3F3; width:600px; -webkit-transition-duration: .5s; font-family: consolas;"><div id="perma"><div class="textp"><a href="{Permalink}"></a></div></div></div></div></center>
    {LinkOpenTag}<meta name="{PhotoAlt}" content="{PhotoAlt}"/> <img src="{PhotoURL-400}" alt="{PhotoAlt}" border="0" width="500" class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()> <div style="font-size: 10px;">
    {block:Caption}
    {Caption}
    {/block:Caption}
    {/block:Photo}
    {block:Photoset}
    {Photoset-600}
    {block:Caption}
    {Caption}
    {/block:Caption}
    {block:PostNotes}
    {/block:PostNotes}
    </div></div>
    {/block:Photoset}


    P.S. The profile i seen with the image shake, he has the same profile theme as me.

    http://doperespect.tumblr.com/

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

    Default

    What's the URL to the problem page where the script doesn't work? I looked at http://fusels.tumblr.com but don't see the script installed.
    DD Admin

  10. #9
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hello, ddadmin

    thank you for taking the time to answer me back. when you say URL i really don't fully know what that mean's i just hope you mean my profile page

    http://lx-artizticthoughtsz-lx.tumblr.com/


    And this page has the script installed on it http://doperespect.tumblr.com/ as you can see its just like my page just with the shake image script installed.

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

    Default

    Looking at your page, none of your images carry the required attributes needed to get that image to shake, for example:

    Code:
    <img src="man.gif" class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()" />
    Add the code in red to the desired images on your page.
    DD Admin

  12. The Following User Says Thank You to ddadmin For This Useful Post:

    ProNtylex (03-16-2011)

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
  •