/* Plugin Name: image_cycling_home The above line is a lie, but makes this file easily editable as a plugin in Wordpress. Description: THIS IS NOT A PLUGIN. This is a file containing javascript code, so don't try to activate it as a plugin! It is recommended to edit this file in the "Plugin File Editor". This file is located in "wp-content/plugins/image_cycling_home/" and needs to be backed up. */ /* * All pictures in this gallery must have the same aspect ratio or parts of the web page will bounce around as the pictures cycle. Crop and scale your pictures to make this so. * 1024x350 pixels has been used and works well for acceptable screen resolution and speedy downloads. * Update the "imgs" code below to add/subtract or change the order or timing of pictures being shown in this gallery. * Edit this file directly in the "Edit Plugins Editor" or upload new versions of this file directly to wp-content/plugins/image_cycling_home/ file folder. * Clear web browser data, then reload the gallery's webpage to check your work. */ ( function() { var imgs = new Array(); var imgcnt = 0; var thisimg = 0; /* Note: The image that was already loaded before calling this plugin will be shown for the same interval as these images. Next line is skipped on first pass, but used on following passes. */ imgs[imgcnt++] = 'https://www.seniornetli.org/content/images/cycling/home/photo_1_c.jpg'; imgs[imgcnt++] = 'https://www.seniornetli.org/content/images/cycling/home/photo_4_c.jpg'; imgs[imgcnt++] = 'https://www.seniornetli.org/content/images/cycling/home/photo_3_c.jpg'; function rotate() { if( document.images) { thisimg++; if( thisimg >= imgcnt) thisimg = 0; document.getElementById('image_cycling').src = imgs[thisimg]; } } /* Interval is in milliseconds (1 second = 1000 milliseconds) */ setInterval( rotate, 5000); } ) ();