{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/265","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project1","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/265/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/265/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/265/events","html_url":"https://github.com/ga-wdi-exercises/project1/issues/265","id":177621872,"number":265,"title":"Issue with adding and removing classes to change background images","user":{"login":"merubin","id":19254862,"avatar_url":"https://avatars.githubusercontent.com/u/19254862?v=3","gravatar_id":"","url":"https://api.github.com/users/merubin","html_url":"https://github.com/merubin","followers_url":"https://api.github.com/users/merubin/followers","following_url":"https://api.github.com/users/merubin/following{/other_user}","gists_url":"https://api.github.com/users/merubin/gists{/gist_id}","starred_url":"https://api.github.com/users/merubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merubin/subscriptions","organizations_url":"https://api.github.com/users/merubin/orgs","repos_url":"https://api.github.com/users/merubin/repos","events_url":"https://api.github.com/users/merubin/events{/privacy}","received_events_url":"https://api.github.com/users/merubin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-18T01:23:33Z","updated_at":"2016-09-18T20:22:49Z","closed_at":"2016-09-18T20:22:49Z","body":"I am having an issue where I cannot swap my images for a element.  I can do it by actually changing the background-image css tag, but I want to swap the class based on the state of my game.\r\nI have 7 .gif images for the various states of the game.\r\n\r\n\r\n<img width=\"800\" alt=\"screen shot 2016-09-17 at 9 13 51 pm\" src=\"https://cloud.githubusercontent.com/assets/19254862/18612036/ae84a0ce-7d1b-11e6-9d9f-caa6de72eeda.png\">\r\n\r\nThe HTML  is initalized and set to level zero image and will load the proper image as the level class is also part of the <DIV> container element.\r\n<img width=\"774\" alt=\"screen shot 2016-09-17 at 9 16 45 pm\" src=\"https://cloud.githubusercontent.com/assets/19254862/18612050/2a57d04a-7d1c-11e6-8d7c-87b1fc876ff0.png\">\r\n\r\n\r\nThe js code to do the swap is the **_setHangLvl_** method:\r\n\r\n<img width=\"1061\" alt=\"screen shot 2016-09-17 at 9 11 14 pm\" src=\"https://cloud.githubusercontent.com/assets/19254862/18612026/73c7152a-7d1b-11e6-868d-7d3ef6c7c186.png\">\r\n\r\nIn the debugger, I see the class added, but the but the old class still remains.  Here  is a screen shot of the window:\r\n\r\n<img width=\"1152\" alt=\"screen shot 2016-09-17 at 9 04 28 pm\" src=\"https://cloud.githubusercontent.com/assets/19254862/18612013/ec428634-7d1a-11e6-82a4-59efa186361c.png\">\r\n\r\nI did a push of my code at this point.  \r\nthe github url to my repository is [here](https://github.com/merubin/hangman)\r\nAny help would be appreciated.  Thanks,  Mike\r\n"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/comments/247874533","html_url":"https://github.com/ga-wdi-exercises/project1/issues/265#issuecomment-247874533","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/265","id":247874533,"user":{"login":"merubin","id":19254862,"avatar_url":"https://avatars.githubusercontent.com/u/19254862?v=3","gravatar_id":"","url":"https://api.github.com/users/merubin","html_url":"https://github.com/merubin","followers_url":"https://api.github.com/users/merubin/followers","following_url":"https://api.github.com/users/merubin/following{/other_user}","gists_url":"https://api.github.com/users/merubin/gists{/gist_id}","starred_url":"https://api.github.com/users/merubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merubin/subscriptions","organizations_url":"https://api.github.com/users/merubin/orgs","repos_url":"https://api.github.com/users/merubin/repos","events_url":"https://api.github.com/users/merubin/events{/privacy}","received_events_url":"https://api.github.com/users/merubin/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T20:22:49Z","updated_at":"2016-09-18T20:22:49Z","body":"I tried the \"()\" and It still did not work, then I simplified the method so it would be easier to debug and step through it with the debugger.  That led me to find out that the operator precedence was correct and did not need the parens.  But it led me to find out I had misspelled the class name.\r\nThank you for the reply!\r\nThis issue is now solved but it opened up another one that I can find out.  The issue was a typo where the class defined had a \"-\" and I was using an \"_\" underscore to change it.  I don't know how many times I looked at it but getting away for a few hours then coming back opened my eyes. The bigger problem I have is I made an assumption that the class I need to remove is lvl-1 which is true but in my testing where I send in levels not in sequence or perhaps a reset of the game where we go back to zero it won't be true.  for now I will just make a circular assumption that the states of the game go in order from 0-6 then when we go to reset the game we can set it back to zero  and delete six.  Probably better would be to find out what classes the element has and just delete it if I can figure that out.  "}}
{"actor":{"display_login":"merubin"}}