كود وضع جمله متحركه عكسياً في وسط الصفحه ضعه في منطقة body مع تغير الجمله كما هو موضح بالكود كود PHP:
<style type="text/css">
#supertext {
position:absolute;
left:0;
top:0;
visibility:hide;
visibility:hidden;
}
</style>
<script language="JavaScript1.2">
//Configure the below three variables
//1) ضع جملتك هنا
var thecontent='<h2><font color="#0000FF"> ضع جملتك هنا</font></h2>'
//2)
var hidetimer='';
//3)ضع سرعة تحرك الجملة من 1 الى 50
var BallSpeed = 20;
///NO NEED TO EDIT BELOW THIS LINE///////////
var contentWidth;
var contentHeight;
var maxBallSpeed = 50;
var xMax;
var yMax;
var xPos = 0;
var yPos = 0;
var xDir = 'right';
var yDir = 'down';
var superballRunning = true;
var tempBallSpeed;
var currentBallSrc;
var newXDir;
var newYDir;
function initializeBall() {
if (********.all) {
xMax = ********.body.clientWidth
yMax = ********.body.clientHeight
********.all("supertext").style.visibility = "visible";
contentWidth=supertext.offsetWidth
contentHeight=supertext.offsetHeight
}
else if (********.layers) {
xMax = window.innerWidth;
yMax = window.innerHeight;
contentWidth=********.supertext.********.width
contentHeight=********.supertext.********.height
********.layers***91;"supertext"***93;.visibility = "show";
}
setTimeout('moveBall()',400);
if (hidetimer!='')
setTimeout("hidetext()",hidetimer)
}
function moveBall() {
if (superballRunning == true) {
calculatePosition();
if (********.all) {
********.all("supertext").style.left = xPos + ********.body.scrollLeft;
********.all("supertext").style.top = yPos + ********.body.scrollTop;
}
else if (********.layers) {
********.layers***91;"supertext"***93;.left = xPos + pageXOffset;
********.layers***91;"supertext"***93;.top = yPos + pageYOffset;
}
animatetext=setTimeout('moveBall()',20);
}
}
function calculatePosition() {
if (xDir == "right") {
if (xPos > (xMax - contentWidth - BallSpeed)) {
xDir = "left";
}
}
else if (xDir == "left") {
if (xPos < (0 + BallSpeed)) {
xDir = "right";
}
}
if (yDir == "down") {
if (yPos > (yMax - contentHeight - BallSpeed)) {
yDir = "up";
}
}
else if (yDir == "up") {
if (yPos < (0 + BallSpeed)) {
yDir = "down";
}
}
if (xDir == "right") {
xPos = xPos + BallSpeed;
}
else if (xDir == "left") {
xPos = xPos - BallSpeed;
}
else {
xPos = xPos;
}
if (yDir == "down") {
yPos = yPos + BallSpeed;
}
else if (yDir == "up") {
yPos = yPos - BallSpeed;
}
else {
yPos = yPos;
}
}
function hidetext(){
if (********.all)
supertext.style.visibility="hidden"
else if (********.layers)
********.supertext.visibility="hide"
clearTimeout(animatetext)
}
if (********.all||********.layers){
********.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
window.onload = initializeBall;
window.onresize = new Function("window.location.reload()");
}
</script>