There are many places where clones are used in Web pages, such as the dynamic loading of content when the page scrolls to the bottom, which can be implemented using clones.
Cloning usually first put out the template separately, and set the style to Display:none, with the jquery clone () implementation
1 <Divclass= "Panel Panel-default clone-box">2 <Divclass= "Panel-heading">3 <ahref= "javascript:;"class= "Flex">4 <Divclass= "Panel-title">5 <span></span>6 <imgsrc= "Img/work2.jpg"class= "Work1">7 </Div>8 </a>9 </Div>Ten <Divclass= "Panel-collapse collapse"> One <Divclass= "Panel-body"> A <P>Completed today</P> - <Pclass= "Finish-detail"></P> - <P>Difficulty or summary</P> the <Pclass= "Summary">None, if there can be written!</P> - </Div> - </Div> - </Div>
1 . cone-box{2 display:none; 3 }
Next is the play, The Clone () method of jquery:
1 var clone = $ (". Clone-box"). Clone (true); 2 clone.removeclass ("Clone-box"); 3 $ (this). attr ("Data-dismiss", "modal"); 4 $ ('. Weekbao. Panel-group '). prepend (clone);
True in the Clone () method means that even events are cloned together when cloning.
The cloning method of jquery clone ()