Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ben Bastow
24,657 PointsMake a Website Black and white with a button
Hey! I am doing ICT GCSE and i need to add accessibility features and one of the ways I was thinking of doing this was having a button to change the whole site black and white or to high contrast or something. But how could i do this? because I tried and it didnt work so if you have any idea can you help me please?
Thanks very much
Ben
6 Answers
christopher smith
5,831 PointsYou can use JQuery to change different CSS values on a button click. But what might work better is using JQuery to switch stylesheets on button click. That way you can have a colorblind stylesheet and a normal view stylesheet.
I saw a few different solutions when googling for it, but this one seemed nice http://www.marcofolio.net/webdesign/create_a_better_jquery_stylesheet_switcher.html
Gloria Dwomoh
13,116 PointsHi Ben Bastow , you can do it by changing the CSS of the page with the click of the button. Check this. I hope this helps :)
Kofi Owusu Acheampong
20,320 PointsHey Ben, there might be various ways to achieve your goal. Do you mind showing us what you tried so we can help you correct that?
Ben Bastow
24,657 Pointshey! I can't since it is at school and the stuff i made at school I cannot get from home :( But I deleted it as well and forgot how I did it :(
Ben Bastow
24,657 Pointshey!! thank you guys for both of your solutions I will try both of them out! Thank you very much!
Gloria Dwomoh
13,116 PointsYou are welcome
Ben Bastow
24,657 Pointshey!! thank you guys for both of your solutions I will try both of them out! Thank you very much!
christopher smith
5,831 PointsGL! Hope it works for you.