Issues with your account? Bug us in the Discord!

Know DHTML/Java Script? if so, HELP! PLEASE!

ok, I am STUCK. This is an assignment that is due tomorrow evening, the teacher is unreachable, the book is absolutly USELESS, it never talks about anything like this....

here is what I'm supposed to do in the .js file:

"Create a new function named "swapIt()". The function should have three parameters: id1, id2, id3. Within the function, convert the three id variables from text to objects: object1, object2, and object3, using the getObject() function found in the API file. Create three variables; z1, z2, and z3, which are equal to the z-index values of object1, object2, and object3, respectivly. Change the z-index value of object1 to z3, Change the z-index value of object2 to z1. Change the zindex value of object3 to z2.


this is what I have so far, but I'm 99% certain I have it seriously messed up:

function swapIt(id1, id2, id3) {
if (isNS) obj1="document."+id1;
if (isIE) obj1=id1+".style";
var object=eval(obj1);
if (isNS) obj2="document."+id2;
if (isIE) obj2=id2+".style";
var object2=eval(obj2);
if (isNS) obj3="document."+id3;
if (isIE) obj3=id3+".style";
var z2=eval(obj3);
}


then, inside the HTML file, I have three objects, "Kids, Fiction, and NFiction" I'm supposed to have the swapImages() function use the showIt function from the API to swap the z-index values of those three objects, using the swapIt function, and have it run every 2 seconds. So in effect, one image appears on the screen, and every two seconds changes to the next one....

I'm absolutly stumped, and no one I know knows java/DHTML....

HELP! PLEASE!

Comments

  • JackNJackN <font color=#99FF99>Lightwave Alien</font>
    Slide show script using Layers eh?

    I'd suggest looking at examples of that kind of script (searching the internet for existing scripts)...

    ;)

    Try these:

    [url]http://www.csus.edu/web/tutorials/slideshow.htm[/url]

    [url]http://www.macromedia.com/support/dreamweaver/interactivity/slideshow/[/url]

    [url]http://martin.f2o.org/javascript/create_slideshow[/url]

    [url]http://javascript.about.com/library/scripts/blslideshow.htm[/url]

    [url]http://www.htmlgoodies.com/primers/jsp/hgjsp_27.html[/url]

    [url]http://wwwneu.dlr.de/Young_people_daily_life/slideshow-js-tutorial.html[/url]

    [url]http://webby.free.fr/trucs/javascript/javascript_images_slideshow.html[/url]
  • A2597A2597 Fanboy
    thanks Jack, teach FINALLY replied, she helped a little, not enough that its working, but enough to get me in the right direction. :)
Sign In or Register to comment.