Reputation: 49813
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;
}
Upvotes: 5
Views: 781
Reputation: 21368
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.
Upvotes: 2
Reputation: 15686
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');
}
);
Upvotes: 1