Solution
解决方案
var options = { opacity: opacity }; //Many thanks to David Higgins for his help
var direction;
if(id == "chat") {
direction = {right: dir + amt, top: dir + amt };
} else if(id == "rplayed") {
direction = {left: dir + amt, top: dir + amt };
} else if(id == "info") {
direction = {right: dir + amt, bottom: dir + amt };
} else if(id == "player") {
direction = {left: dir + amt, bottom: dir + amt };
}
$.extend(options, direction);
$(wid).animate(options, 200);
var options = { opacity: opac