简体   繁体   English

如何为添加的动画 <br> 与jQuery

[英]How to animate the adding of <br> with Jquery

I have a page with images in an inline block that when clicked br tags and added before and after it so that the image is on its on line. 我有一个页面,该页面在嵌入式块中具有图像,单击br标签并在其之前和之后添加该页面,以使图像在线。

http://gyazo.com/ddfdd7da4d949ec48341b585d2495ab6 http://gyazo.com/ddfdd7da4d949ec48341b585d2495ab6

Here is a gif of what happens. 这是发生的事情的表情。

Is there anyway I can animate the movement of the divs? 无论如何,我可以为div的运动设置动画吗?

Edit: Apologies I forgot to add my code. 编辑:抱歉我忘了添加代码。

$(document).ready(function() {
$(".imageFace").click(function(){
    id = $(this).attr('id');
    $(this).before("<br>");
    $(this).after("<br>")
});});

I assume by animating BR's, you want to animate pushing down content? 我假设通过对BR进行动画处理,您想制作动画来压低内容吗? Rather than animate BR, you can use JQuery to animate the top margin, as in this example: jQuery animate margin top 您可以使用JQuery来对顶部空白进行动画处理,而不是对BR进行动画处理,如下例所示: jQuery animate margin top

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM