• 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

    • Just the price of doing business. The scamble to pull as much from the web as possible is happening, and it's happening before a case like this changes how or what is legal do to with AI in terms of data harvesting. But even then as we've seen with the likes of Google who ignore cookie requests and just accept the fact they'll get fined, it's built into their business price model now. AI is here, its not going away. Their reward if any from the court case would be best suited to trying to incorprate AI or licence their end points as authentic human verified content. The problem is, as we've seen these same news papers are using AI themselves.
    • Which finger's fingernail are we talking about? I can see how not having this info can lead to massive differences in interpretation.
    • This Chinese company is reportedly developing a feature Apple and Samsung can only dream of by Hamid Ganji While companies like Apple and Samsung have been relatively conservative with their devices’ battery capacities in recent years, Chinese manufacturers have taken the competition to the next level by introducing significantly larger batteries. However, the latest report from China suggests that a local company may already be developing a smartphone with a whopping 14,000mAh battery. Chinese leaker Digital Chat Station claimed on Weibo that a smartphone maker is developing a device with a 14,000mAh battery. If true, it would be the largest battery ever used in a smartphone and could, in theory, provide up to a week of battery life on a single charge. The leaker did not reveal the name of the company behind the device, but there are some clues. This week, HONOR unveiled the X80 Pro Max in China with an 11,000mAh battery and 90W wired charging support. The company also launched the Honor Win in January, which packs a 10,000mAh battery. HONOR, a former subsidiary of Huawei, has a proven track record of developing smartphones with unusually large batteries. However, other Chinese brands, including Xiaomi, have also launched devices such as the Xiaomi 17 Pro Max with 7,500mAh batteries. Though Chinese users on Weibo also believe the company behind the new battery is HONOR. Interestingly, Digital Chat Station said the device with the 14,000mAh battery weighs around 220 grams, making it lighter than the Apple iPhone 17 Pro Max (233 grams) and slightly heavier than the Samsung Galaxy S26 Ultra (214 grams). The iPhone 17 Pro Max currently packs a 5,088mAh battery in eSIM-only versions, while the Galaxy S26 Ultra features a 5,000mAh battery. Neither device is expected to see a dramatic increase in battery capacity in its next-generation successor. So when it comes to battery comparison, Chinese brands are unbeaten. HONOR smartphones are currently available in the EU, but the Chinese brand has no official presence in the United States due to restrictions imposed by the U.S. government.
  • Recent Achievements

    • First Post
      kinowa earned a badge
      First Post
    • Rookie
      krychek57 went up a rank
      Rookie
    • Grand Master
      Jaybonaut went up a rank
      Grand Master
    • One Year In
      Philsl earned a badge
      One Year In
    • Dedicated
      Scoobystu earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      461
    2. 2
      +Edouard
      171
    3. 3
      PsYcHoKiLLa
      136
    4. 4
      Michael Scrip
      78
    5. 5
      Xenon
      77
  • Tell a friend

    Love Neowin? Tell a friend!