Response title
This is preview!
$('.container').each(function(){
if (loc == "AB") {
$(this).find(".image").insertAfter($(this).find(".name"));
$(this).find(".desc").insertAfter($(this).find(".image"));
}
if (loc == "BA") {
$(this).find(".image").insertAfter($(this).find(".desc"));
$(this).find(".name").insertAfter($(this).find(".image"));
}
if (loc == "AA") {
$(this).find(".desc").insertAfter($(this).find(".name"));
$(this).find(".image").insertAfter($(this).find(".desc"));
}
if (loc == "BB") {
$(this).find(".name").insertAfter($(this).find(".image"));
$(this).find(".desc").insertAfter($(this).find(".name"));
}
});
$('.container').each(function(){
if (loc == "AB") {
$(this).find(".image").insertAfter($(this).find(".name"));
$(this).find(".desc").insertAfter($(this).find(".image"));
}
if (loc == "BA") {
$(this).find(".image").insertAfter($(this).find(".desc"));
$(this).find(".name").insertAfter($(this).find(".image"));
}
if (loc == "AA") {
$(this).find(".desc").insertAfter($(this).find(".name"));
$(this).find(".image").insertAfter($(this).find(".desc"));
}
if (loc == "BB") {
$(this).find(".name").insertAfter($(this).find(".image"));
$(this).find(".desc").insertAfter($(this).find(".name"));
}
});
© 2013 jQuery Foundation
Sponsored by and others.