利用定位寫的仿彈幕效果,一碰到邊緣就出現bugCSS:.dmMsg{ position:absolute; display: inline-block; right:0; top:0; color:#fff; font-size: 22px; font-weight: 700; text-align: center; line-height: 1em; z-index: 100;}JS:var $temp = $("<span class='" + msgType + " " + moveInType + "' data-count="+ msg_count +">" + message + "</span>");$('.' + parent).append($temp); $temp.animate({ 'right':'100%' },15000,loop);}function loop(){ $temp.css('right','-400px'); $temp.animate({ 'right':'100%' },15000,loop);}問題是彈幕只要碰到屏幕左邊文字就折行了:但是輸入數字就不會這樣,我沒有給固定寬度,不知道為什么會這樣?
仿彈幕效果遇到的bug
aluckdog
2018-11-22 14:15:53
