Toolbar to change background colour of web pages

View: New views
3 Messages — Rating Filter:   Alert me  

Toolbar to change background colour of web pages

by newbeee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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!!

Re: Toolbar to change background colour of web pages

by newbeee () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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  

[CODE]
function BGColour(event)
{
var currentDocument = getBrowser().getBrowserForTab( getBrowser ).selectedTab ().contentDocument;
currentDocument.body.style.backgroundColor = "magenta";
BrowserReload();
}
[/CODE]


Re: Toolbar to change background colour of web pages

by newbeee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've that function fixed now. Thanks

On Sat, Apr 12, 2008 at 2:31 PM, newbeee <chrissie.bee@...> wrote:

whenever i insert the following code into my js file referenced by the
toolbar, and install the toolbar none of the toolbar functions(just pop up
messages to check event handlers) accessed by any of the buttons work(these
worked previously), any ideas what's going wrong? or what i could try?? i
can't see what i'm doing wrong

[CODE]
function BGColour(event)
{
var currentDocument = getBrowser().getBrowserForTab( getBrowser
).selectedTab ).contentDocument;
currentDocument.body.style.backgroundColor = "magenta";
BrowserReload();
}
[/CODE]

:-/
--
View this message in context: http://www.nabble.com/Toolbar-to-change-background-colour-of-web-pages-tp16447325p16648703.html
Sent from the XUL - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
XUL News Wire      - http://xulnews.com
XUL Job Postings   - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org
_______________________________________________
xul-talk mailing list
xul-talk@...
https://lists.sourceforge.net/lists/listinfo/xul-talk


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
XUL News Wire      - http://xulnews.com
XUL Job Postings   - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org 
_______________________________________________
xul-talk mailing list
xul-talk@...
https://lists.sourceforge.net/lists/listinfo/xul-talk