Question

hi is there anyone can show me ho to reproduce this css3 effect with jquery using some delay/animation speed ?

.element:hover{
-moz-transform: scale(1.3) rotate(0deg) translate(0px, 0px) skew(0deg, 0deg);
-webkit-transform: scale(1.3) rotate(0deg) translate(0px, 0px) skew(0deg, 0deg);
-o-transform: scale(1.3) rotate(0deg) translate(0px, 0px) skew(0deg, 0deg);
-ms-transform: scale(1.3) rotate(0deg) translate(0px, 0px) skew(0deg, 0deg);
transform: scale(1.3) rotate(0deg) translate(0px, 0px) skew(0deg, 0deg);
z-index:9999;

}

JSFIDDLE

Was it helpful?

Solution

Here is something PRETTY close to what you are asking. I'm sure you could tweak it to your liking

$('.element').hover(function(){

    $(this).css('position','relative').animate({
        height: $(this).height()*1.3,
        width: $(this).width()*1.3,
        left: '-=' + $(this).width() /4,
        top: '-=' + $(this).height() /4,
        'fontSize': $('.element').css('fontSize').substring(0,$('.element').css('fontSize').length -2) * 1.3 + 'px'
    },'fast');
},
 function() {                 
       $(this).css('position','relative').animate({
        height: $(this).height()/1.3,
        width: $(this).width()/1.3,
        left: 0,
        top: 0,
        'fontSize': $('.element').css('fontSize').substring(0,$('.element').css('fontSize').length -2) / 1.3 + 'px'
    },'fast');
}            

);

http://jsfiddle.net/dTkhM/2/

OTHER TIPS

Here's how I might go about implementing a simple rotation (not taking frame rate into account):

$(function(){
    (function(n){
        this.interval = n;
        this.transform = {
            'rotation': 0
        };

        this.start = function(){
            setInterval(this.update, this.interval);
        };

        this.update = function(){
            this.transform['rotation'] = (this.transform.rotation + 10) % 360;
            $('div').css('transform', 'rotate(' + this.transform.rotation + 'deg)');
        };
        return this;
    })(30).start();
});

http://jsfiddle.net/dbrecht/82aUL/1/

This demonstrates a simple animation. You should be able to figure out how to put the rest of it together.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top