I am working on a wordpress plugin which allows a user to enter a image url and konami code. When the konami code is entered an image pops up, but I can’t get it to animate, I am somewhat unfamiliar with jQuery and Javascript, and I am just starting to learn it… Any help would be fantastic!
<script type="text/javascript" charset="utf-8">
if ( window.addEventListener ) {
var kkeys = [], konami = "{$this->opts['wpk_code']['current']}";
window.addEventListener("keydown", function(e){
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
var elms=document.getElementById("konami").style;
elms.display=(elms.display=="block")?"none":"block";
}
}, true);
}
</script>
Have a play with some of the examples on jQuery’s animate() – they seem to do what you want.
Try this:
HTML: