1. Home
  2. Computing & Technology
  3. JavaScript

More Object Functions
Part 1 : Introduction

By Stephen Chapman, About.com

The first set of Object Functions that I made available determine where an object currently is and whether or not it is visible. This second set of functions allows you to move an object or change its visibility.

The following functions are provided in this collection.

The first function is setObjVis(objectID,vis) with vis being set to either 'visible' or 'hidden' to determine whether or not the object should be visible.

The second function is toggleObjVis(objectID) which will hide the object if it is visible or show it if it's hidden.

The next function is moveObjTo(objectID,x,y) which will move the object to a specified position.

The other move function is moveObjBy(objectID,x,y) which moves the object by the specified distance from it's current position.

The final function is moveObjLayer(objectID,z) which changes which layer that the object is in.

Let's start by looking at what these functions do.

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Script Library
  5. Function Library
  6. More JavaScript Object Functions>

©2009 About.com, a part of The New York Times Company.

All rights reserved.