|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Toolbar to change background colour of web pages
I'd like to create a toolbar for FireFox consisting of one button to change the background colour of the currently viewed webpage.
At present I have a button "Background Colour", when I click on it I have set up a popup message to say "Code for Changing Background Colour goes here". Ideally I'd like to use a colorpicker for the user to select their colour choice, and then the selected colour be applied as the background colour of the webpage. To change the background colour of a page would it simply be a case of placing a css sheet over the top of the currently viewed page? And if so any ideas on how i do this? Thanks!! |
|
#2
|
|||
|
|||
|
I think a simpler way would be Javascript.
Link to the main element, where the bgcolor attribute is. then use DOM to select the element, and change the bgcolor to the selected color in the color picker. |
|
#3
|
|||
|
|||
|
I've implemented the functions of buttons to display a popup msg when they are pressed. This works
But whenever i insert the following code into my js file referenced by the toolbar(instead of the popup code), and install the toolbar and press the button that executes this event nothing happens, any ideas what's going wrong? or what i could try?? i can't see what i'm doing wrong Thanks guys! Code:
function BGColour(event)
{
var currentDocument = getBrowser().getBrowserForTab( getBrowser ).selectedTab ().contentDocument;
currentDocument.body.style.backgroundColor = "magenta";
BrowserReload();
}
|
|
#4
|
|||
|
|||
|
Fixed
thanks! that function now for the functions to change text color, font and size Quote:
|
|
#5
|
|||
|
|||
|
Fixed
thanks! that function now for the functions to change text color, font and size ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Toolbar to change background colour of web pages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|