SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    function undefined , help needed

    hi ,
    i have the following functions.
    Code:
    <body onload="slideShow();">
    ----
    var i; 
    function slideShow(){
    	var div = document.getElementById("featured");
    	var img=div.getElementsByTagName("img")[0];
    	var imgArr=new Array();
    	imgArr[1]="../public/images/featured/01.jpg";
    	imgArr[2]="../public/images/featured/02.jpg";
    	imgArr[3]="../public/images/featured/03.jpg";
    	imgArr[4]="../public/images/featured/04.jpg";
    	function t(){
    		if(this.paused==1){switchPaused();}
    		if(this.paused==0){ casing(); }
    		function one(){
    			if(i==1){
    			this.current=1;
    			img.src=imgArr[1];
    			}
    		}
    		function two(){
    			if(i==2){
    			this.current=2;
    			img.src=imgArr[2];
    			}
    		}
    		function three(){
    			if(i==3){
    			this.current=3;
    			img.src=imgArr[3];
    			}
    		}
    		function four(){
    			if(i==4){
    			this.current=4;
    			img.src=imgArr[4];
    			}
    		}
    		alert(two());
    ...continues on.
    the alert gives
    Undefined
    I don't know what to do , so i ask here .
    How to make this work ?

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i think i've found the solution in this post http://www.sitepoint.com/forums/showthread.php?t=665688
    should've used the search form first.
    Sorry for any inconvenience.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •