+ 3
Can I add image in animation attrubute
2 Answers
+ 1
maybe with some js???
$(document).on("click","#addPic", function(e){
//div element having attr display:none;
$("#Pic").animate({height:"toggle"},500, function(){
$(this).append("<img>").data({src:"sourceOfImg", alt:"altTextForImg"});
});
what this will do is if you have a hidden div on the webpage
<div id="Pic" style="height:500px; display:none;"></div>
and a button to activate it or something
<input type="button" id="addPic" value="Add Pic">
the onclick event will be triggered.
the animation which will take 500ms
will toggle the height of the div (0 -> 500px)
and once the animation is finished the function will be called which will add an image as a child element to the div.
hope this was what you were looking for!!