Created
November 11, 2016 11:47
-
-
Save icalik/6dbda1259aad11d056fd0c7074d4b958 to your computer and use it in GitHub Desktop.
Link
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script | |
src="https://code.jquery.com/jquery-3.1.1.js" | |
integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" | |
crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var dizi | |
dizi = [1,2,3,4,5,6,7,8,9,10,11,12,13]; | |
goster(); | |
$('li').on("click",function() { | |
//alert(this.id); | |
sec = this.id; | |
secilen_veri = dizi[sec]; | |
dizi.splice(sec,1); | |
dizi.unshift(secilen_veri); | |
console.log(dizi); | |
goster(); | |
}); | |
function goster(){ | |
$('#sira').empty(); | |
for (var i = 0; i< dizi.length; i++) { | |
//dizi[i]; | |
$('#sira').append("<li id='" + i + "'> LINK "+ dizi[i] +" </li>"); | |
} | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<ul id="sira"> | |
</ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment