#My solution to the following challenge:
For this challenge your solution should be entirely javascript and should work if pasted directly into the javascript console of the browser after the page has loaded.
Go to www.marmot.com and add at least 2 products to your cart. Then return to the home page. Write a javascript snippet that can be run in the console of a browser that does the following:
Extract the number of items in the cart, the cart total, and item images from the page. Store them in javascript variables.
Create a trigger that activates when the user scrolls into the bottom 10% of the page.
The trigger should show a centered overlay on top of the site that displays the information gathered above and two buttons. One button closes the overlay and the other takes the user to the cart page. It should have a style consistent with the website. Design matters.
Behind the overlay add a semitransparent black background that obscures the site. The overlay should be able to trigger multiple times if dismissed.
BONUS
- Describe some other ways you might be able to obtain the information needed for the overlay (think generally, not specific to THIS website).