Why won't this div animate?
I added animation using jquery but it doesn't work:
$('.test-container').click(function(){
$(this).css('background-color', 'rgb(119, 119, 119)');
$(this).animate({right: '50%', opacity: 0.3}, 1000);
})
Here is the generated jfiddle: http://jsfiddle.net/eJhdm/2/
Am I doing something clearly wrong here? I do not see it.
+3
Hard worker
source
to share
3 answers
You need to set the position in the div.
<div class="test-container" style="/*other CSS*/ position:absolute;">testtt</div>
http://jsfiddle.net/3HhWx/
+6
haltabush
source
to share
<div class="test-container" style="position: relative;width:100px; height:100px">testtt</div>
add "position: relative;" to style to give him some wiggle room; -)
+3
nograde
source
to share
Misspelling is the programmers of the first malicious enemy.
you forgot ;
after})
http://jsfiddle.net/eJhdm/13/
There wasn't really any for the div in question position
.
0
user900360
source
to share