• 0

How to transition through a few images?


Question

Hi there everyone. I've done a couple of simple websites for local businesses (All people I know) and one asked me to add a banner at the top. So I created a div and set the banner image as the background. It worked very well. Now though, they just asked me if they could put 4 different banner images up there and have it transition through the images.

Does anyone know if I can do this with html or css?

I've never done anything like that and did a few searches online and found a couple of interesting posts but nothing that I could make work.

So I figured at this point I should ask and see if anyone has done this on here and how best it can be done.

Thanks, :)

3 answers to this question

Recommended Posts

  • 0

Looks like you could put something together using CSS and jQuery. I found this code which I imagine you could rework to fit what you were looking for (for example, rather than the continuous scroll like they show in the example, tweak it to switch every x seconds).

Sorry if it's not quite what you're looking for, I've been out of the game for a while now.

  • 0

The Mandigo theme for Wordpress has this feature for the theme header, I use both on my blog! It cycles on page refreshes, and I think it can be timed too :)

I'm not sure if this'll help but here's a snippet. It uses PHP but might be useful nonetheless for you somehow:

// if we didn't find one but the "random headers" option is enabled

if (!$user_header && $mandigo_options['header_random_image']) {

shuffle($user_headers);

$user_header = array_shift($user_headers);

}

  • 0

Thank you both for your help. I'm not using WordPress unfortunately, so I won't be able to use a theme for that.

I will take a look at the example Intrinsica posted to see how that one works. :)

I did find this example here: http://css-tricks.com/snippets/jquery/simple-auto-playing-slideshow/

But as simple as this one sounds, I still can't get it working. On my site the images are showing stacked one below the other (Instead of all in the same place) and they also don't fade. LOL I wasn't sure where to put the jquery file so I placed in in a jquery folder in my website directory and then also in the directory with my css and then also in the directory with the html files. Still no luck. :(

This topic is now closed to further replies.
  • Posts

    • I still use speccy on windows systems as a quick sysinfo thing. I know there's better but really it was the first one I used of its type
    • Google Chrome 149.0.7827.201 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Google Chrome 149.0.7827.201 security fixes: [N/A][513138301] High CVE-2026-13281: Integer overflow in Mojo. Reported by Google on 2026-05-14 [N/A][517522620] High CVE-2026-13282: Use after free in Payments. Reported by Google on 2026-05-28 [N/A][522561151] High CVE-2026-13283: Use after free in AdFilter. Reported by Google on 2026-06-11 Important to know! The offline installer links do not include the automatic update feature. Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | Direct Link | 131.0 MB Download: Google Chrome Offline Installer 32-bit | Direct Link | 119.0 MB Download page: Google Chrome Portable Download: Chrome ARM64 | Direct Link View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Fire and rehire. Doubt the work contracts are as favourable. Smart tactic using AI to do it legally.
    • > And, of course, it includes in-game purchases. Sigh.. of course it does. I just don't understand why anyone would want to play this on PC, when the far superior AoE 2/DE exists. Just kill this with fire already. Or a trebuchet.
    • Normally you'd just want to use Ventoy, but Rufus is handy when: - Ventoy doesn't work (some BIOSes can be weird) - You're mainly interested in creating a single Windows live USB and not interested in a multi-boot / Linux USBs - You want to automate your Windows installations (Rufus supports creating/injecting an autounattend.xml file which fully automates a Windows install). You can do this with Ventoy as well, but it requires a bit more of an effort. Also worth nothing is that both automatically bypass Windows 11's artificially imposed restrictions (TPM, CPU etc).
  • Recent Achievements

    • Week One Done
      xvvxcvv earned a badge
      Week One Done
    • One Month Later
      xvvxcvv earned a badge
      One Month Later
    • Enthusiast
      Xonos went up a rank
      Enthusiast
    • Conversation Starter
      Admir earned a badge
      Conversation Starter
    • First Post
      The_Focal_Point earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      408
    2. 2
      +Edouard
      171
    3. 3
      PsYcHoKiLLa
      129
    4. 4
      neufuse
      69
    5. 5
      Xenon
      68
  • Tell a friend

    Love Neowin? Tell a friend!