This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I have a simple little homepage that I created to give me all the links that I frequently need at work, and like any pet project it's grown in scope to where my entire team is using it and starting to share it with others.
Now that I have almost 200 images for the random number generator to select, I am finding that I sometimes I want to “Lock” the wallpaper so I can enjoy it for a few days.
I am imagining an image of a lock in the bottom left corner that would appear “unlocked” if the wallpaper is random, and by simply clicking the icon it would write a cookie to your machine containing the image number, and change the image to a lock that’s been “locked” so users know the image is “Locked In”. When the page loads I will check for the cookie, if it exists I can then set the image to the value in the cookie, if it’s not there they get a random image. If the user clicks the lock icon again the cookie would be removed, and the image reverted to the “Unlocked” image.
I think I can handle the cookie create/read/delete once the onclick event is called, but I can’t hack through the image “toggle” component. Does anyone contribute some sample code, or suggest a better approach?
Currently this page is only an html page; I would prefer to keep it that way.