I have an <object> with an id of 'objectID'.
I can modify its position with .css:
$('#objectID').css({'top': "+=200px"});
But when I use .animate it won't work:
$('#objectID').animate({'top': "+=100px"}, 1000);
or
$('#objectID').animate({top: "10"}, slow);
Or any other variation, which works on divs. Is there a limitation to animating object elements?
Since the <object> tag is not supported you can hack out your own animation like this:
var obj = $('#objectID');
var speed = 50;
var distance = 100;
var i = setInterval(function() {
obj.css({'top': '+=1px' });
if (parseInt(obj.css('top')) > distance) {
clearInterval(i);
}
}, speed);
Change the speed variable to get the animation speed you need.
Here's the jsfiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With