Change BG Color Of A Div By Clicking A Table Cell?
Dec 5, 2011
I basically want the background color of a div (banner) to change when the user clicks a green or blue table cell. So if they click the blue table cell, the backgound color of the div changes to blue (its green by default).
Also, when they have picked what color they want, I'd like the color to be stored in the value of the form 'BannerBGColor' so I can post their banner color to database. code...
Is it possible to change a table cell background color or add any attributes based on a criteria, anyway, here's my scenario. I have a php table dynamically created onthefly, (let say on load), then i have a sql query returning some values. So illustrating: Table: Sql Result 1 2 3 4 5 2 5 7 6 7 8 9 10
What I am trying to achieve is use the sql result to add attributes to the table cells so for the illustration say i want to add a bold attribute to all table cell which corresponds to the sql result, the result would be, Result: 1 2 3 4 5 6 7 8 9 10 Any plugins out there? "Its php (server-side) and jquery (client-side) talking...but I know there is a way!
what is wrong with this script. I put an onClick= changeColor(this);" in my <td> tag to call the script but still not working.
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a calendar, 7 across by whatever needed down, and I manually create it each month - not a big deal.
Every day I go in and darken the background color of the current day's cell by changing the appropriate <TD> entry to <TD bgcolor="c63800"> and uploading the page. Takes well under a minute start to finish. Thus the calendar gradually changes color over the course of the month, with the past dates dark and the future dates lighter and thus more apparent to the eye.
But I have to ask if there's a nifty way in which this might be done automatically, based on the current day and the number (the day of the month) that follows the <TD> entry.
Can someone tell me how to do this if it is possible?
Is there a way to dynamically (e.g. upon onClick) change the bgColor attribute of a table cell? I tried cell.setAttribute("bgColor", someColor), where someColor was a string of the form "#RRGGBB", but nothing happened.
Also, how can I set the mouse cursor to be an arrow when it hovers over these table cells? (It's an insertion bar now.)
What I really want to happen is for a mouse over to change table cell content. I would like to have a list in the left cell, when you mouse over the list items it will change content(image text and maybe formated in a table) in the cell on the right.
I'm trying to be tricky and its not been working LOL. I have a gallery page with lots of thumbnails that load up. What I wanted to do was have a "LOADING IMAGE" GIF in each of the table cells so that the user would see visually how many more images were going to load up. That bit is fine but when all the thumbs have loaded I want to change that Cell background image to something else.
How would I do this? Would I be able to reference them all at once or would I have to reference each individual cell one at a time.
To better illustrate my point see this this link :
I am trying to change the background color of a table based on the value of a picklist. For instance. if the picklist value was "1", then the background color of the table should be red. Not sure where I went wrong in my code. code...
I'm trying to create a cell in a table which changes color depending which radio button is checked.
<td name="third" class="boryellow" onmouseover="this.className='borblue'" onmouseout="this.className='boryellow'">cell</td> even when dealing with empty images - click on link will change border of different element - imgs, but not span or td ... <a href="#" onclick="document.all.xxx.className='borblue'; document.all['name'].className='borblue';
Replacing any element link by "third" or "spanx" will cause stuck ant not executing other actions.
Is there any way to have the background color change in a cell only when the mouse is over the link? This is what I have so far: <td class=topnav2 onClick="location.href='AboutAD/overview.htm'" onMouseOut="this.style.backgroundColor='#9966FF'"onMouseOver="this.style.backg roundColor='#660099'" bgcolor="#9966FF" width="107" height="45"valign="middle"> <a class="topnav2" href="AboutAD/overview.htm">About Alzheimer's</a> Currently you rollover the cell it changes color, I just want this effect when you roll over the text.
There are two radio buttons, sometimes one will be disabled, other times the other will be disabled. I would like to make a script that: First: Changes the color of surrounding text of the disabled radio button to the color grey. Second: Checks the other radio button.
This was my plan: I would make a script that: First: Removes all the current classes and add the class "greyed_out" (or better: change only the color of) the parent element, all siblings and children of siblings (if any) of the radio button that is disabled at that time.Second: Sets the attribute "checked to the other radio button". I made a script, but when I set the bottom radio button to disabled the script doesn't work:
have been trying to rework this to call additional, independent sets of colors to cycle through (so it would loop thru a set of grays, a set of primary colors, etc). I would use perhaps a different function name in the HTML to call different sets of colors. If this is more complex than I think it is, I think 3 sets would be plenty. demo link of script in current state at bottom)