From 37a59f04bcf9c20734e454c78930ba90e55695a1 Mon Sep 17 00:00:00 2001 From: Connor L Jackson Date: Fri, 2 Dec 2016 16:22:44 -0500 Subject: [PATCH] Better popups on request page --- html/javascript/request.js | 14 +++++++++++--- html/webpages/requestPage.html | 24 +++++++++++++++++++++++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/html/javascript/request.js b/html/javascript/request.js index bd94d4f..013bc49 100644 --- a/html/javascript/request.js +++ b/html/javascript/request.js @@ -87,9 +87,15 @@ function addToCart(){ var cart = getCartItems(); //this is an array cart.push(id); //push to bottom of cart localStorage.setItem('cart', JSON.stringify(cart)); + $('#added').fadeIn(1000); + $('#added').fadeIn(1000); + $('#added').fadeOut(1000); + } + else{ + $('#already').fadeIn(1000); + $('#already').fadeIn(1000); + $('#already').fadeOut(1000); } - else - alert("That item is already in your cart!"); } function inCart(id){ @@ -137,4 +143,6 @@ function isUnavailable(id){ } } return 0; -} \ No newline at end of file +} + +//this code allows a message to appear that indicates that the item was successfully placed in the shopping cart. diff --git a/html/webpages/requestPage.html b/html/webpages/requestPage.html index 7fb32bb..e0d333b 100644 --- a/html/webpages/requestPage.html +++ b/html/webpages/requestPage.html @@ -10,7 +10,7 @@ Synchrony Financial - +