• Hello folks,
    I wonder how to make a post (in this case a sticky post) shake or move on the webpage.

    For example, take the wp admin login page. When you enter a wrong login the border around the login page is moving from left to right and back really fast. See this image

    I want my sticky post move that way one time when visiting my website.

    Bartbroersen.nl

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nblauw

    (@nblauw)

    Imagelink >

    Forgot to close the linktag *

    Thread Starter nblauw

    (@nblauw)

    Found someting with js code > wp_shake_js

    function wp_shake_js() {
    	if ( wp_is_mobile() )
    		return;
    ?>
    <script type="text/javascript">
    addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    function s(id,pos){g(id).left=pos+'px';}
    function g(id){return document.getElementById(id).style;}
    function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}}
    addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);});
    </script>
    <?php
    }

    Someone can help me with implanting this code on my wordpress installation and make it work with sticky posts

    Thanks!

    joseph445

    (@joseph445)

    how to add shake effect to front end log in widget?
    Anybody can help? I’m a newbie

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to make a post/item shake or move on the page’ is closed to new replies.