From the course: Controlling CSS with JavaScript
Unlock this course with a free trial
Join today to access over 24,000 courses taught by industry experts.
Challenge: Stylesheet switcher
From the course: Controlling CSS with JavaScript
Challenge: Stylesheet switcher
(uplifting offbeat music) - [Instructor] To help you solidify what you've learned right away, I've created several challenges and placed them throughout the course. This is the first challenge. It's a style sheet switcher. This is what I want you to end up with. The page that we've been working with so far now has two buttons at the top list view, and grid view. And when you click on grid view, we changed a view from lists to grid. And then back again. To make this work, you need to enable or disable a separate style sheet that has that grid layout. Here's what I want you to do. First off disabled, a grid style sheet on load. It's sitting in the document and I want you to disable it so that it's not loaded into the browser. Second, add button functionality to toggle the grid when selected, and finally highlight the current layout button so the user always knows whether they are on the list layout or on the grid…
Contents
-
-
-
Access all style sheets in a document2m 46s
-
(Locked)
Find specific style sheet in a document5m 20s
-
(Locked)
Disable a style sheet using JavaScript2m 29s
-
(Locked)
Access rules from a style sheet4m 18s
-
(Locked)
Insert and delete rules from a style sheet4m 40s
-
(Locked)
Challenge: Stylesheet switcher2m 9s
-
(Locked)
Solution: Stylesheet switcher3m 43s
-
-
-
-
-