/*缁夎濮╅弬瑙勭《*/ function move_obj(obj, move_w, move_h, x, y, l, t, m) { if (obj == undefined) { alert("閺傝纭剁拫鍐暏闁挎瑨顕?鐠囪渹绱堕崗銉︻劀绾喖寮弫锟?"); return; } move_w = move_w == undefined || move_w == "" ? $(window).width() : move_w; //濮樻潙閽╃粔璇插З閼煎啫娲?姒涙顓诲ù蹇氼潔閸c劌褰茬憴鍡楀隘閸╃喎顔旀惔锟 move_h = move_h == undefined || move_h == "" ? $(window).height() : move_h; //閸ㄥ倻娲跨粔璇插З閼煎啫娲?姒涙顓诲ù蹇氼潔閸c劌褰茬憴鍡楀隘閸╃喖鐝惔锟 x = x == undefined || x == "" ? 1 : x; //娑撯偓濞嗏剝鎸夐獮宕囆╅崝銊ㄧ獩缁傦拷,姒涙顓?px y = y == undefined || y == "" ? 1 : y; //娑撯偓濞嗏€崇€惄瀵感╅崝銊ㄧ獩缁傦拷,姒涙顓?px l = l == undefined || l == "" ? 0 : l; //閻╃顕禍宸刼dy閻ㄥ嫯鎹f慨瀣寜楠炲厖缍呯純锟?姒涙顓? t = t == undefined || t == "" ? 0 : t; //閻╃顕禍宸刼dy閻ㄥ嫯鎹f慨瀣€惄缈犵秴缂冿拷,姒涙顓? m = m == undefined || m == "" ? 1000 / 60 : m; //鐠佲剝妞傞崨銊︽埂,閸楁洑缍呭В顐ゎ潡,姒涙顓?0ms function moving() { x = l >= move_w - $(obj).width() || l < 0 ? -x : x; y = t >= move_h - $(obj).height() || t < 0 ? -y : y; l += x; t += y; $(obj).css({ right: 0, top: 0 }); $(obj).css({ transform: "translate3d(-" + l + "px, " + t + "px, 0px)", }); } var timer_move = setInterval(function () { moving(); }, m); //閹剙浠犻崑婊勵剾鏉╂劕濮 $(obj).mouseover(function () { $(this).children(".close_port").show(); clearInterval(timer_move); }); //榧犳爣鐐瑰嚮鍚庣户缁繍鍔 $(obj).mousedown(function(){ $(this).children(".close_port").hide(); timer_move=setInterval(function () { moving(); },m); }); //缁夎绱戞Η鐘崇垼閸氬海鎴风紒顓$箥閸旓拷 $(obj).mouseout(function () { $(this).children(".close_port").hide(); timer_move = setInterval(function () { moving(); }, m); }); //閸忔娊妫村ù顔剧崶,閸忔娊妫撮崥搴″涧閼充粙鈧俺绻冮崚閿嬫煀妞ょ敻娼伴幍宥堝厴閺勫墽銇?娑旂喎褰叉禒銉ㄥ殰鐎规矮绠熼崗鎶芥4閸旂喕鍏 var close = '
鑴颤/div>'; $(obj).append(close); $(".close_port").css({ position: "absolute", display: "none", width: "100%", height: "30px", bottom: 0, left: 0, color: "red", border: "0px solid red", background: "#ccc", textAlign: "center", lineHeight: "20px", cursor: "pointer", opacity: "0", }); $(obj).on("click", ".close_port", function () { //婵″倹鐏夐張澶婄サ婵傛鐡欑痪褎绱撳ù顔剧崶,閸氬本妞傚〒鍛存珟鐎涙劗楠囩€规碍妞傞崳锟?濞撳懐鎮婄紓鎾崇摠 $(obj).find(".close_port").trigger("mouseover"); clearInterval(timer_move); $(this).parent().remove(); }); }