• Allllllllrighty. I’ve been working on building a togglable sidebar using javascript and css. I’ve got everything working except for one little thing:

    When you click on the tab to toggle the sidebar to be shown (the sidebar starts hidden), the tab image is supposed to change…which it does. The problem is, when you click the tab to hide the sidebar again, the tab image is supposed to change back to the original image…which it’s *not* doing…and I can’t figure out why.

    Anyone want to take a look at the script (all is included in the page) and give me any ideas as to why the image won’t change back?

    https://www.armageddondesign.net/jstester/index.html

    BTW, feel free to use the code to create your own togglable sidebar. ??

    Any help appreciated and thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this – look at the beginning of the script – change tab.src==”hide.gif” to tab.src=”hide.gif”

    Thread Starter armageddondesign

    (@armageddondesign)

    Nope. That breaks that whole script and the tab never does it’s initial change. It needs the == there.

    Anyone else? I really need to get this figured out so I can launch this new blog.

    hrm – well, I tried going to your link again, it didn’t work at first, but then I navigated to https://www.armageddondesign.net/jstester/hide.gif, because the image wasn’t showing up; I saw the image finally, went back to the original address you posted, and suddenly I see the image and it is working (showing/hiding)? Weird.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JavaScript CSS = I need a little help.’ is closed to new replies.