.png)
.png)
Horizontal Auto slider and popup message source code
Owner
Shoreful islamDate and
7627FD45 b...ref
In this example, we create a container with a fixed width and height to hold the slider. The slider itself is a flex container with each slide having a width of 400 pixels. The slides are positioned horizontally using the translateX
property.
When a thumbnail image is clicked, the JavaScript code calculates the index of the clicked slide and adjusts the slidePosition
accordingly to slide to the desired position. The setInterval
function is used to automatically slide the cards every 3 seconds.
You can add more slides by duplicating the slide
div and modifying the image URL and link in the anchor (a
) tags.
Please make sure to replace the placeholder image URLs (thumbnail1.jpg
, thumbnail2.jpg
, thumbnail3.jpg
) with the actual URLs of your thumbnail images, and replace the website URLs (https://www.example1.com
, https://www.example2.com
, https://www.example3.com
) with the desired target websites.
Feel free to customize the styling and modify the code according to your specific needs.
Here's an example of the HTML code for a popup message with a thumbnail and a "Learn More" button:
0 Review