onClick pixel color change
A lot information about changing background color/image , font color, row color etc. but I can't find a clue how to change, on mouse click, one or a few pixels (at the clicking spot) to a different color.
Plz help if you can
Be creative, imaginative...think about it! Pixels on a webpage cannot change color, but elements can. So wherever the mouse is clicked, it sounds like you want to create an element (e.g. div, span, img, whatever) that is a 1x1 or 2x2 or 3x3, or whatever size you want it.
So what you need to look for when searching is:
1) How to get the position of a mouse click on the screen
3) How to use CSS to position the element created in #2 where you want it.
Yep, this would be easy. What I want, is several users to click on an element, and each click to be graphically represented as a few surrounding pixels changing colors. And I want to see the effects in real-time.
Using a transparent pixel, change the background color onclick. Since the pixel is transparent the background color will display through. Real trick is painting the entire screen with pixels.
54 68 65 42 65 61 72 4D 61 79
Rather than pushing data from the server, which could be quite intensive depending on how popular the site is, I'd use AJAX called using a setTimeout from when the page loads. Every time the AJAX request is complete, get it to update the image. If you want it to appear 'live', set the timeout to run every second or so.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread