Pergunta

I am trying to append all elements of the same class "td.top" except last one to another place, but I can't figure out how is this possible.. Any ideas are welcomed, I am kind of stuck.. Thank you for any input. This is the code I have now:

$(document).ready(function() {
if ( $(window).width() < 960) {

$("td.top").appendTo("ul.sub");

} else {

//something else

}
});
Foi útil?

Solução

How about:

$("td.top").not(":last").appendTo("ul.sub");
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top