This project is a simple web application that cycles through a series of images and includes an animated text element. It uses jQuery for DOM manipulation and animations.
- Animated text display
- Automatic image cycling
- (Commented out) Manual image cycling with button click
- Ensure you have jQuery included in your project.
- Copy the provided JavaScript code into your project's script file.
- Make sure you have the necessary HTML structure in place, including an element with the ID "content" and its parent element.
The script performs the following actions:
- Removes the element with ID "content".
- Adds an animated text span to the page.
- Prepends a section with an image and a button to the parent of the removed "content" element.
- Automatically cycles through a predefined list of images every 1.5 seconds.
The script uses an array of image filenames. Ensure these images are present in an /images/
directory relative to your HTML file:
- image-1.jpg to image-13.jpg
- To change the animation duration or properties, modify the
animate()
function call. - To adjust the image cycling speed, change the interval in the
setInterval()
function (currently set to 1500 milliseconds). - To use manual cycling instead of automatic, uncomment the button click event listener code and comment out the
setInterval()
function.
- jQuery (version not specified in the provided code)
- The code assumes specific HTML structure. Ensure your HTML matches the expected structure for the script to work correctly.
- The manual image cycling feature is currently commented out. Uncomment and adjust as needed if you prefer button-controlled cycling.