Om vi antar HTML så här:
- one
- two
- three
Så om du klickar på "Två" flyttar du det till toppen av listan.
$("li").click(function() ( $(this).parent().prepend($(this)); ));
Fungerar för flera listor ...
Om vi antar HTML så här:
- one
- two
- three
Så om du klickar på "Två" flyttar du det till toppen av listan.
$("li").click(function() ( $(this).parent().prepend($(this)); ));
Fungerar för flera listor ...