SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2008
    Location
    Atlanta, GA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Two events problem?

    Thank you so much, first off, for taking interest in my issue!


    I have a 1/2 working version of what I want to do at

    http://www.iamaubrey.com/315_2/index.html

    The other half works here:

    http://www.iamaubrey.com/315_4/indexTest.html

    Explanation:
    The first page has a working version of a giant slider for all of the content on my site.
    The second page has the corresponding nav elements that should make the slider work as well.
    Somewhere in my Javascript I've messed up. I alerted the var of "homeIda" (in global.js) inside the function and I get nothing. When I ran it just in front of the onclick function I got an alert of the HTML properties that were called by the getElementById line. This is where I believe the problem is

    Intentions:
    I would like for both the content of the site as seen in the first example to work with the navigational elements seen in the second example.

    I am a pretty novice coder, as it may be quite clear. So if you could take that into mind if you respond... I'd greatly appreciate that!

    Aubrey

  2. #2
    SitePoint Member
    Join Date
    Mar 2008
    Location
    Atlanta, GA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow got it!

    I figured out what I was doing wrong. I was calling the wrong elements. After tossing borders on everything I figured out what to target.

    Here was the problem code:
    Code JavaScript:
    var homeIda = document.getElementById('content1');      
    	var noLink1 = document.getElementById('navContent1');     
    	var cwm = document.getElementById("contentWrap").style.left;
    	var cwm2 = document.getElementById("navWrap").style.left;
    	cwm=parseInt(cwm);
    	cwm2=parseInt(cwm2);
    	homeIda.onclick = function(){
    	contentMove(cwm, 0);
    	return false;
    	}
    	noLink1.onclick = function(){   <~This needed to be all together above the previous return false... with the return falses at the end.
    		divBgMove(cwm2,0);
    		return false;
    	}

    and this is what i did to fix it:

    Code JavaScript:
    	var homeId1 = document.getElementById('navContent1');
    	var noLink1 = document.getElementById('navCont');
    	var cwm = document.getElementById("contentWrap").style.left;
    	var cwm2 = document.getElementById("navWrap").style.left;
    	cwm=parseInt(cwm);
    	cwm2=parseInt(cwm2);
    	homeId1.onclick = function(){
    	contentMove(cwm, 0);
    	noLink1.onclick = function(){
    	divBgMove(cwm2,40);
    	return false;
    	}
    	return false;
    	}

    Thanks to everyone who read this and was giving it some thought, again, I appreciate it!

    -Aubrey


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
  •