Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a functions as follows

var selectionName = [
  "CatOne100", "CatOne200", "CatOne300", "CatOne400", "CatOne500",
  "CatTwo100", "CatTwo200", "CatTwo300", "CatTwo400", "CatTwo500",
  "CatThree100", "CatThree200", "CatThree300", "CatThree400", "CatThree500",
  "CatFour100", "CatFour200", "CatFour300", "CatFour400", "CatFour500",
  "CatFive100", "CatFive200", "CatFive300", "CatFive400", "CatFive500",
  "CatSix100", "CatSix200", "CatSix300", "CatSix400", "CatSix500"
];

var questionCount = 0;
var divName = "";
var answerDivName = "";
var answerShadowDivName = "";
var categoryUpdate = "";
var amount = 0;
var category = "";
var categoryAmount = "";
var selection = "";

window.onload = function() {
  for (i=0; i < selectionName.length, i++) {
    selection = selectionName[i];
    $("#" + selection).bind("click", { sName: selection}, makeSelection );
}

function startGame() {
  $("#startPage").css("z-index", 0);
  $("#mainPage").css("z-index", 110);
  $("#sidebarLeft").css("z-index", 110);
  $("#sidebarRight").css("z-index", 110);
  $("#gameTitle").css("z-index", 120);

  $("#gameTitle").animate({
    left:'-=1240px',
    top:'+=1075px'
  },'slow');

  $("#main, #sidebarLeft, #sidebarRight, #gameTitle").bind("click", showGameboard

}

OK, I'll go to JSFiddle at some point here, but the issue I am having is that when it steps through a supposed String, it treats it like it is stepping through an array, by going through all previous values of it. I've tried nulling the string and just "" erasing it. Somehow it keeps all the previous calls through the variable.

share|improve this question
2  
better to first go to jsfiddle, and then post. Right now you're giving incentive for people to go look at other questions while you're still working on your question –  Mike 'Pomax' Kamermans 2 hours ago
2  
+1 @Mike'Pomax'Kamermans. Which you've not even asked! –  user3558931 2 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.