WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : A ball is attached to your mouse cursor with an elastic cord!
Categories : Java Script, DHTML, Graphics Update Picture
knik
Date : Jul 15th 2000
Grade : 3 of 5 (graded 12 times)
Viewed : 13602
File : ball.zip
Images : No Images for this code example.
Search : More code by knik
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<html>

<head>

<!-- The JavaScript below is copyright (C)2000 knik@crosswinds.net -->

<script type="text/javascript" language="JavaScript">
<!--
var NN=(navigator.appName == "Netscape" &&
navigator.userAgent.indexOf("Mozilla") != -1 &&
parseInt(navigator.appVersion) >= 4);
var IE=(navigator.userAgent.indexOf("MSIE") != -1 &&
navigator.userAgent.indexOf("Mozilla") != -1 &&
parseInt(navigator.appVersion) >= 4);
var layerRef="null",styleSwitch="null";
var mouseX=-8,mouseY=-8;
var X=-8,Y=-8;
var dX=0,dY=0;
var minX=0,minY=0;
var maxX=0,maxY=0;

function init() {
if (NN) {
layerRef = "document.layers";
styleSwitch = "";
eval(layerRef+'["body"]'+styleSwitch+'.width= window.innerWidth');
eval(layerRef+'["body"]'+styleSwitch+'.height= window.innerHeight');
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = mouseCoords;
moveBall();
}
if (IE) {
layerRef = "document.all";
styleSwitch = ".style";
eval(layerRef+'["ball"]'+styleSwitch+'.width= 14');
eval(layerRef+'["ball"]'+styleSwitch+'.height= 14');
document.onmousemove = mouseCoords
id = window.setInterval("moveBall()",5);
}
}
//-->
</script>

<script type="text/javascript" language="JavaScript 1.2">
<!--
function mouseCoords(e) {
if (NN) {
mouseX = e.pageX;
mouseY = e.pageY + 7;
}
if (IE) {
mouseX = document.body.scrollLeft + event.clientX;
mouseY = document.body.scrollTop + event.clientY + 7;
}
}

function moveBall() {
if (NN) {
minX = window.pageXOffset + 8;
minY = window.pageYOffset + 8;
maxX = window.pageXOffset + window.innerWidth - 8;
maxY = window.pageYOffset + window.innerHeight - 10;
}
if (IE) {
minX = document.body.scrollLeft + 8;
minY = document.body.scrollTop + 8;
maxX = document.body.scrollLeft + document.body.clientWidth - 8;
maxY = document.body.scrollTop + document.body.clientHeight - 12;
}
if (eval(layerRef+'["ball"]'+styleSwitch+'.visibility != "hide"')) {
X += dX/40;
Y += dY/40;
if (X < minX) {dX = -dX; X = minX};
if (Y < minY) {dY = -dY; Y = minY};
if (X > maxX) {dX = -dX; X = maxX};
if (Y > maxY) {dY = -dY; Y = maxY};
drawBall(X-7,Y-7);
dX = (dX + mouseX - X)*0.98;
dY = (dY + mouseY - Y)*0.98;
if (NN) {setTimeout('moveBall()',4)};
}
}

function drawBall(left,top) {
eval(layerRef+'["ball"]'+styleSwitch+'.left=' + left);
eval(layerRef+'["ball"]'+styleSwitch+'.top=' + top);
}
//-->
</script>

<style type="text/css">
A {text-decoration:none}
#ball {position: absolute; visibility: visible; top: -16; left: -16; z-index: 1;}
#body {position: absolute; visibility: visible; z-index: 0}
</style>

</head>

<!-- ============================================================== --
>
<body onload="init()"
bgcolor="#eeeeee" text="#000033" link="#000099" vlink="#000066" alink="#990000">

<div id="ball">
<script type="text/javascript" language="JavaScript">
<!--
if (NN || IE)
{document.write('<img src="ball.gif" height=14 width=14 alt="">')}
//-->
</script>
</div>

<div id="body">
...
</div>

</body>

</html>



Fancy Quick Access Navigation Link
Categories : Java Script, Navigation, User Interface, DHTML, Beginner Guides
Simple Dhtml tree using DOM
Categories : DHTML, Java Script
Menu in sliding bar or tree style. Handles frames by using small amount of javascript. Handles external and internal pages. Allows custom code to replace a menu item.
Categories : PHP Classes, PHP, Java Script, DHTML
Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML
JavaScript Fade In Text Messages
Categories : Java Script, DHTML
JAVASCRIPT interface class to the eBusiness Charts generatation remote service.
Categories : Java Script, Graphics, Charts and Graphs
This is a script that list all image files on a given directory, and displays the thumbnails nicely formated within an HTML table. It also make use of JavScript to open pop up windows when the users want to see the full photo.
Categories : Graphics, PHP, Complete Programs, Java Script
KuPro1.0 - This application is for Libraries, To see their books and to maintain users books. This version is in Turkish, future vers may have English Support.
Categories : PHP, Java Script, DHTML
Random Image
Categories : Java Script, Graphics
Table editable dynamic form with edit + selection (select / option) + checkbox.
Categories : Java Script, DHTML, User Interface, CSS, HTML
Unobtrusive javascript for maintaining scrollable layer state
Categories : DHTML, Java Script, HTML
Form validations using javascript and including all validations in one message
Categories : HTML and PHP, Java Script, Form Processing
How to get the Focus (Cursor) into a Form-Element.
Categories : HTML, Java Script
Upload images restricted by pixel size (Picture width and Picture Height)
Categories : PHP, HTML and PHP, Graphics
PHPixel - output of 1 pixel transparent/colored gif for counters etc.
Categories : PHP, Graphics, HTML and PHP