R
E
S
O
U
R
C
E
S
       Question Index      Products & Services      Contact Us      Links


WebHatchers will design & develop your site for you.
_______________________

Website Menu Heaven: side or top popup menus, buttons, image rotators, navbars, tons more.
_______________________

Send us your questions and wittiest comments.
_______________________

Report errors on our site.
_______________________

Share your neatest DHTML examples with us; we may publish them.
_______________________


_______________________

      QUESTION INDEX      

Question Index
Browser Insanity
JavaScript
Animation
Buttons and Menus
CSS and HTML
PHP
Personal Status Boards
Content Management
   Systems
Website Directory
   CMS Systems


 INFORMATIVE ARTICLES 

Menus-and-Buttons-
Part-I.htm


Menus-and-Buttons-
Part-II.htm


Change-Div-Size-Color-
and-Location-with-the-
W3C-DOM.htm


Bouncing-Ball-Animation-
with-the-W3C-DOM.htm


Style-Changes-with-the-
W3C-DOM.htm


Animation-with-the-
W3C-DOM.htm


Window-Play-and-Some-
Important-DOM-Methods.htm


Using-getElementsByTagName
-and-getElementsByName.htm


The-CSS-Resources-Intro-
Page.htm


Convert-Word-Files-to-HTML-
and-Install-Editor2-to-
Use-Instead-of-NotePad.htm


CSS-Issues.htm

What Are Fifteen Simple Methods of Doing Web-Page Pop-ups?

Security levels from Javascript and PHP input filtering

What is a regular expression general input validator?

What is a regular expression user name validator?

What is a regular expression password validator?

What is a regular expression email validator?

What is a regular expression URL validator?

How can I convert a Javascript array to a PHP array?

How can I Dynamically Create Input Boxes with Validation?

How do I use JavaScript Object Notation (JSON) in PHP and JavaScript to convert strings and arrays from PHP to JavaScript?

How do I add html to a web page with JavaScript, PHP or ssi includes?

How do I add html to a web page with JavaScript includes?


PHP

How do you put PHP variables in URL and link text?

What is PHP Code for Multiple PSB Hosts?

What is Registration PHP Code for Multiple PSB Hosts?

What is Registration PHP Code for Multiple PSB Hosts with a captcha?

What is Administrator PHP Code for Multiple PSB Hosts?

What's the PHP code for a script for a PSB?

What's the PHP code for a script for PSB updating?

What's the PHP code for a script if you forgot your user name?

What's the PHP code for a script if you forgot your password?

What's the PHP code for a script to change a member's email address?

What's the PHP code for a script to connect to a MySQL database?

What's the PHP code for a script to close a member's account?

What's the PHP code for a script to edit group member?

What's the PHP code for a script to add group member?

What's the PHP code for a script to reset a MySQL table's data to its original?

What's the PHP code for a script to edit a MySQL table's data?

What's the PHP code for a script to change a username?

What's the PHP code for a script to change a password?

What's the PHP code for a script to delete group member?

What's the PHP code for a script to view membership data?

What's the PHP code for a script to change an administrator's password?

What's the PHP code for a script to logout?

What's the PHP code for a script to login?

Security levels from Javascript and PHP input filtering

Security levels and PHP

How can I convert a Javascript array to a PHP array?

What is PHP Code to Prevent Duplicate Data Input - Like User Names or Members?

What is PHP Code for PSB Status Update for Multiple PSB Hosts?

How do I sort 1 PHP array and have the other arrays sort in parallel to how the first array sorts?

How do I use JavaScript Object Notation (JSON) in PHP and JavaScript to convert strings and arrays from PHP to JavaScript?

How do you do PHP-to-JavaScript String Conversion with No JSON?

How do you Convert PHP String to JavaScript String?

How do you Post a JavaScript Array to a PHP Array?

How do you send a value to PHP using JavaScript?

Info on unwanted primary field auto-sorting

How can I do instant article font size, font family, and paragraph formatting with radio buttons?

How can I create custom HTML tags that are safer for MySQL databases?

How can I edit text from MySQL databases by using a textarea box?

How can I highlight matched search terms in a MySQL database table search?

How can I search using not only exact phrase matching but also a series of words to match in a MySQL database table search?

What's the code for an Ajax and PHP Based Input Filter?

Ajax and PHP Based Insult Auto-Completer

How can I use PHP and MySQL for Checking Key Codes to Allow Update to a New Software App Version?




Personal Status Boards (PSB™)

Standard Free PSB

PSB Pro Version

Social PSB

Social PSB Plus (with Email)

Business PSB

Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement




Article Content Management System

Content Management System Introduction

Content Management System—Article Navigation

Content Management System—Article Indexing

Content Management System—Article Editing

Content Management System—Article Searching

Content Management System—Article Deleting

Content Management System—Article Writing

Content Management System—Article Reading

What are the terms of use for our Article Content Management System?




Website Directory Content Management System

Website Directory—Delete Category

Website Directory—Delete URL

Website Directory—Add URL

Website Directory—Add Category

Website Directory—Directory Creating

Website Directory—View by Category (Demo Code)

Website Directory—View by URL (Demo Code)

Website Directory—View by Category (Demo)

Website Directory—View by URL (Demo)

Website Directory—View

Website Directory—View (Demo)



Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

Animation with the W3C DOM

We've used path animation in animationw3cdom.html and to do that we created an array of 21 number pairs representing screen coordinates. The normal W3C DOM getElementById method was utilized on a colored div box that was the sole animation object where e represents the properties of the div object that are addressable:

var e = document.getElementById('box');

Here's the div object getting its new coordinates from the path array; here's the array element number zeroer once the end of the array is reached; here's the stop flag returning out of the function if it’s set; and here's and the ¼-second interval timer between moves:

e.style.left = pathl[j] + 'px';

e.style.top = patht[j] + 'px';

if (j<20){ j++}else{j=0};

if(s){s=0;return;}

t=setTimeout("movediv()",250);

And here's one of the three size/color changers in the movediv() function:

if(j==14){e.style.color = 'darkblue'; e.style.backgroundColor = 'lightblue'; e.style.width = '200px'; e.style.height='200px'; e.style.fontSize = '64px';}

Here's the event capturing needed to get the keypress code to work in Netscape (there's no good excuse for this; it just simply requires event capturing in Netscape!). Note that the last line starts up the event for IE, which needs no capturing, while the first two lines are only for Netscape:

var Netscape=(navigator.appName.indexOf("Netscape") != -1);

if(Netscape){document.captureEvents(Event.KEYPRESS);}

document.onkeypress = getakey;

The getakey() function allows the visitor to hide the box or show it again, accompanied by our smart-assed commentary. The self.focus() method is needed for Netscape to get the idea that the focus should be here—it’s located in the body tag. "p" is the id of the HTML paragraph to change DOM style. The innerHTML property is very powerful in that it can allow one to dynamically rewrite most HTML code.

function getakey(){

var e = document.getElementById('box');

if (f==0) {e.style.visibility = 'hidden';f=1;var obj=document.getElementById("p");obj.innerHTML="NOW AIN'T YOU GLAD YOU DID THAT???!!!<br>(Hit a key after the box disappears to make it reappear.)";}

else{e.style.visibility = 'visible';f=0;var obj=document.getElementById("p");obj.innerHTML="NOW WHAT DID YOU WANNA GO AND DO THAT FOR???!!!<br>(Hit a key after the box disappears to make it reappear.)";}}

The form handling function is called valuecheck(). It has a clearTimeout in it to prevent the setTimeout in the animation function from getting confused and malfunctioning with respect to move intervals. The switch conditional looks at the three possible form values (1, 2 or 3) and executes the correct commands depending on which case matches the value of value. Switch beats if for situations in which specific values of a variable expression need to result in executing certain specific statements. We were surprised the browsers didn’t mind us using that word as a variable. Apparently, as long as we lay off valueOf, we’re okay.

function valuecheck(value){
clearTimeout(t);s=0;

switch(value){
case"1":f=1;getakey();movediv();break;
case"2":s=1;break;
case"3":f=0;getakey();break;
}

The form is standard stuff, but it has an id and the valuecheck() function in the select tag. A change in drop-down value activates the event handler onChange that runs the function. The unused id was in case we wanted to make the form addressable by DOM methods, which it is.

<div style="position:absolute; top:69px; right:10px;">

<form style="color:red;">Choose one, quick!<select name="stop me!" id="f" size="1" onChange="valuecheck(value);">

<option value="1">Make it start again (huh?).</option>

<option value="2">Make it stop, PLEASE!</option>

<option value="3">Make it invisible, NOW!</option></select></form></div>

<div id="box" class="b"><br><b>Hi!</b></div>

This web page experiment uses a form drop-down list box to allow the visitor to make the animation stop, start, or disappear. The key presses can also cause disappearances and reappearances, courtesy of the visibility property values, hidden and visible.