New picture every day?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
alan_sh
 
 
Posts: 1898
Joined: Tue Jan 01, 2019 5:50 pm

New picture every day?

Post by alan_sh »

Is there a way to show a new picture on a web page every day? Obviously, I would preload the pictures, but I haven't seen anything which lets me show just one picture.

cheers - and Happy New Year

Alan
alan_sh
 
 
Posts: 1898
Joined: Tue Jan 01, 2019 5:50 pm

Re: New picture every day?

Post by alan_sh »

Thanks - I understand the code, but I am unsure how to incorporate it into my site.

Any thoughts?
User avatar
KingSparta
 
 
Posts: 311
Joined: Tue Dec 08, 2020 6:00 pm
Location: Earth

Re: New picture every day?

Post by KingSparta »

Page, page html
Retired military, Airborne, Air Assault, and Helicopter Flight Wings.
Enjoys model trains, the internet, and ham radio. Located in Fayetteville, NC, USA.
https://MyAAGrapevines.com
alan_sh
 
 
Posts: 1898
Joined: Tue Jan 01, 2019 5:50 pm

Re: New picture every day?

Post by alan_sh »

KingSparta wrote: Sun Jan 01, 2023 6:06 pm Page, page html
Thanks - I'll give it a go
User avatar
BaconFries
 
 
Posts: 5978
Joined: Thu Aug 16, 2007 7:32 pm

Re: New picture every day?

Post by BaconFries »

KingSparta wrote: Sun Jan 01, 2023 6:06 pm Page, page html
@kingsparta Yes but where? as there is a correct way to ibsert :?
Alan using the script from Dani Web you can insert the javascript as follows Page HTML between <head></head> tags* the image <div></div> insert where you wish to be displayed in what you are using (Layout Grid, Flex) Note you will need to rename the image names to match your own. You may also just want to try using inserting a image as you would normally within the software for the first image. ⁹

Between the <head></head>

Code: Select all

<script>
var dailyPhotos;
var today, img;

dailyPhotos = function() {

   today = new Date();
   weekday = today.getDay();
   showImages = [ ];
   myPhotos = [ "sundayPhoto.jpg", "mondayPhoto.jpg", "tuesdayPhoto.jpg", "wednesdayPhoto.jpg", "thursdayPhoto.jpg", "fridayPhoto.jpg", "saturdayPhoto.jpg" ]; // You must specify the path or file name of your images that will be loaded in a weekday basis.

    if ( document.images ) {
       for ( var x = 0; x < myPhotos.length; x++ ) { 
       showImages[ x ] = new Image();
       showImages[ x ].src = myPhotos[ x ];          
     } img = (( document.getElementById ) ? document.getElementById("yourImageId") : document.images.yourImageId ); // Specify the id of the image that will get raplaced daily.
        img.src = showImages[ weekday ].src;
        img.alt = myPhotos[ weekday ];         
   } return false; // If the browser can't display images, then EXIT FUNCTION.
};
   window.onload = dailyPhotos;

</script>

Code: Select all

Insert where you need
<div id="main">
<img id="yourImageId" src="tuesdayPhoto.jpg" alt="DEMO" />
</div>
alan_sh
 
 
Posts: 1898
Joined: Tue Jan 01, 2019 5:50 pm

Re: New picture every day?

Post by alan_sh »

Thanks - I'll try that in the morning
User avatar
KingSparta
 
 
Posts: 311
Joined: Tue Dec 08, 2020 6:00 pm
Location: Earth

Re: New picture every day?

Post by KingSparta »

it works, you just need to point it to your image folder, right now it is looking in the root folder on the server.
Retired military, Airborne, Air Assault, and Helicopter Flight Wings.
Enjoys model trains, the internet, and ham radio. Located in Fayetteville, NC, USA.
https://MyAAGrapevines.com
Post Reply