為什么克隆了兩次后,第一個后面有間隙,后面三個卻沒有?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <title>使用clone()方法復制元素</title>
? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? </head>
? ??
? ? <body>
? ? ? ? <h3>使用clone()方法復制元素</h3>
? ? ? ? <span class="red" title="hi">我是美猴王</span>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $("body").append($(".red").clone());
? ? ? ? ? ? $(".red").clone().appendTo("body");
? ? ? ? </script>
? ? </body>
</html>
為什么克隆了兩次后,第一個后面有間隙,后面三個卻沒有?求解釋
2016-07-12
同問+1
2016-07-03
我也不知道。