graphics Admin
عدد المساهمات : 594 نقاط : 6930 السٌّمعَة : 4 تاريخ التسجيل : 15/06/2010
| موضوع: أضافة نافذة دعائية متحركة للمنتدى الجمعة أكتوبر 08, 2010 2:11 pm | |
| أضافة نافذة دعائية متحركة للمنتدى - الكود:
-
[/color] [color=#ff0000]<SCRIPT LANGUAGE='JavaScript'><!-- /* */[/color] [color=#ff0000]var popUp = 0; var popURL = 0; var popWidth = 0; var popHeight = 0;[/color] [color=#ff0000]var thisMargin = 10;[/color] [color=#ff0000]var popTopPosition = thisMargin; var popLeftPosition = thisMargin;[/color] [color=#ff0000]var pause = 20; var step = 10; // كل ما زودت الرقم كل ما اسرعت النافذة var timer = 0;[/color] [color=#ff0000]var screenWidth = 0; var screenHeight = 0;[/color] [color=#ff0000]var endX = 0; var endY = 0;[/color] [color=#ff0000]function startPop(thisurl,thiswidth,thisheight) { popURL = thisurl; popWidth = thiswidth; popHeight = thisheight;[/color] [color=#ff0000]popUp = window.open(popURL, "traveler","toolbar=no,width="+popWidth+",height="+popHeight+",top="+popTopPosition+",left="+(popLeftPosition)+"");[/color] [color=#ff0000]screenWidth = window.screen.width; screenHeight = window.screen.height; endX = screenWidth - thiswidth - thisMargin; endY = screenHeight - thisheight - thisMargin; movedown(); }[/color] [color=#ff0000]function movedown() { if (popTopPosition <= endY - 50) { popUp.moveTo(popLeftPosition,popTopPosition); popTopPosition += step; timer = setTimeout("movedown()",pause); } else { clearTimeout(timer); popTopPosition = endY - 50; popUp.moveTo(popLeftPosition,popTopPosition); moveright(); } }[/color] [color=#ff0000]function moveright() { if (popLeftPosition <= endX) { popUp.moveTo(popLeftPosition,popTopPosition); popLeftPosition += step; timer = setTimeout("moveright()",pause); } else { clearTimeout(timer); popLeftPosition = endX; popUp.moveTo(popLeftPosition,popTopPosition); moveup(); } }[/color] [color=#ff0000]function moveup() { if (popTopPosition >= thisMargin) { popUp.moveTo(popLeftPosition,popTopPosition); popTopPosition -= step; timer = setTimeout("moveup()",pause); } else { clearTimeout(timer); popTopPosition = thisMargin; popUp.moveTo(popLeftPosition,popTopPosition); moveleft(); } }[/color] [color=#ff0000]function moveleft() { if (popLeftPosition >= thisMargin) { popUp.moveTo(popLeftPosition,popTopPosition); popLeftPosition -= step; timer = setTimeout("moveleft()",pause); } else { clearTimeout(timer); popLeftPosition = thisMargin; popUp.moveTo(popLeftPosition,popTopPosition); } }[/color] [color=#ff0000]startPop('test.html','300','200'); // ضع رابط البانر هنا[/color] [color=#ff0000]// --></SCRIPT>
| |
|