A Pen by Robin Deng on CodePen.
Created
June 24, 2015 02:42
-
-
Save rlog/36ee5f640788c0c0eecf to your computer and use it in GitHub Desktop.
pJdwxG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>List A</h3> | |
<ul id="a"> | |
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | |
<li>Aliquam tincidunt mauris eu risus.</li> | |
<li>Vestibulum auctor dapibus neque.</li> | |
</ul> | |
<h3>List B</h3> | |
<ul id="b"> | |
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | |
<li>Aliquam tincidunt mauris eu risus.</li> | |
<li>Vestibulum auctor dapibus neque.</li> | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#a li").on('click', function(){ | |
$(this).appendTo('#b'); | |
}); | |
$("#b li").on('click', function(){ | |
$(this).appendTo('#a'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
li { | |
cursor: pointer; | |
list-style: none; | |
border-bottom: 1px solid #ddd; | |
padding: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment