Created
April 5, 2023 18:28
-
-
Save bforrest/b7a037d5431a946772ddf8a38653bc97 to your computer and use it in GitHub Desktop.
Image rotator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img id="daily-image" alt="image of the day" /> | |
<script> | |
// Get a reference to the img element | |
const img = document.getElementById('daily-image'); | |
const baseUri = 'https://southshoreinsurance.sharepoint.com/SiteAssets/Forms/AllItems.aspx?id=%2FSiteAssets%2FDailyPhotos/'; | |
var today = new Date().getDay(); | |
var day; | |
switch (today) { | |
case 0: | |
day = "Sunday"; | |
break; | |
case 1: | |
day = "Monday"; | |
break; | |
case 2: | |
day = "Tuesday"; | |
break; | |
case 3: | |
day = "Wednesday"; | |
break; | |
case 4: | |
day = "Thursday"; | |
break; | |
case 5: | |
day = "Friday"; | |
break; | |
case 6: | |
day = "Saturday"; | |
} | |
img.src = baseUri + day + '.png'; | |
window.onload = function () { | |
GetJSON() | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment