/*�ƶ�����*/ 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;//ˮƽ�ƶ���χ,ĭ����������������� move_h = (move_h == undefined || move_h == '') ? $(window).height() : move_h;//��ֱ�ƶ���χ,ĭ���������������߶� x = (x == undefined || x == '') ? 3 : x;//һ��ˮƽ�ƶ�����,ĭ��3px y = (y == undefined || y == '') ? 3 : y;//һ�δ�ֱ�ƶ�����,ĭ��3px l = (l == undefined || l == '') ? 0 : l;//�����body����ʼˮƽλ��,ĭ��0 t = (t == undefined || t == '') ? 0 : t;//�����body����ʼ��ֱλ��,ĭ��0 m = (m == undefined || m == '') ? 80 : m;//��ʱ����,��λ����,ĭ��80ms 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({ left: l, top: t }); } var timer_move = setinterval(function () { moving(); }, m); //��ֹͣͣ�˶� $(obj).mouseover(function () { $(this).children(".close_port").show(); clearinterval(timer_move); }); //�ƿ���������˶� $(obj).mouseout(function () { $(this).children(".close_port").hide(); timer_move = setinterval(function () { moving(); }, m); }); //�رո���,�رպ�ֻ��ͨ��ˢ��ҳ�������ʾ,ҳ�����զ���رչ��� var close = "
x
"; $(obj).append(close); $(".close_port").css({ position: 'absolute', display: 'none', width: '20px', height: '20px', top: 0, right: 0, color: 'red', border: '1px solid red', background: '#ccc', textalign: 'center', lineheight: '20px', cursor: 'pointer' }); $(obj).on('click', '.close_port', function () { //�����ƕ���ӽ�ư����,ͬʱ����ӽ���ʱ��,������� $(obj).find('.close_port').trigger('mouseover'); clearinterval(timer_move); $(this).parent().remove(); }) }