Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8981711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:24:17+00:00 2026-06-15T20:24:17+00:00

So i have this great slideshow code which works perfectly with my img tags

  • 0

So i have this great slideshow code which works perfectly with my img tags until I wrap them in an anchor tag. instead of just grabbing the img tag the slideshow also grabs the anchor tags and displays them. In other words instead of cycling through 4 images, it cycles through 4 images and then 4 anchor tags. This results in 4 blank images after the initial images.

      <script type="text/javascript">

      $(function(){
          $('div.fadein  a img.bestof:gt(0)').hide();
          setInterval(function(){
        $('div.fadein a img.bestof:first-child').fadeOut()
           .next('img.bestof').fadeIn()
           .end().appendTo('.fadein');}, 
        3000);
      });

      </script>

      <style>
      .fadein { position:relative; width:200px; height:160px; }
      .fadein img { position:absolute; left:0; top:0; }
      </style>

      <div class="fadein">
        <?php foreach ($array as $image){
          print("
           <a href='$image[link]' target='$target'><img src='$image[image]' class='bestof' style='width:200px; height:160px;' ></a>
         "); } ?>
      </div>

Any suggestions I need the anchor tags so that I can make each image clickable. I tried just cycling through the Anchor tags but then no images popped up.

Here is the Generated HTML.

<script type="text/javascript">

$(function(){
    $('div.fadein  a img.bestof:gt(0)').hide();
    setInterval(function(){
      $('div.fadein a img.bestof:first-child').fadeOut()
         .next('img.bestof').fadeIn()
         .end().appendTo('.fadein');}, 
      3000);
});

</script>

<style>
.fadein { position:relative; width:200px; height:160px; }
.fadein img { position:absolute; left:0; top:0; }
</style>

<div class="fadein">

     <a href='http://google.com' target='_blank'><img src='http://4.bp.blogspot.com/-PilKprMNhpo/TVc4rKk_gKI/AAAAAAAAAWo/O3wPK3kIH_8/s1600/two_flowers.preview.jpg' class='bestof' style='width:200px; height:160px;' ></a>

     <a href='http://hooplaha.com' target='_blank'><img src='http://www.redbudfarms.com/wp-content/uploads/2011/01/cone-flowers-preview.jpg' class='bestof' style='width:200px; height:160px;' ></a>

     <a href='http://facebook.com' target='_blank'><img src='http://images.fanpop.com/images/image_uploads/Flower-Wallpaper-flowers-249398_1693_1413.jpg' class='bestof' style='width:200px; height:160px;' ></a>

     <a href='http://bing.com' target='_blank'><img src='http://www.rosarian.com/graphics/images/rose.jpg' class='bestof' style='width:200px; height:160px;' ></a>

     <a href='http://linkedin.com' target='_blank'><img src='http://blog.zap2it.com/pop2it/rainbow-roses.jpg' class='bestof' style='width:200px; height:160px;' ></a>
   </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:24:18+00:00Added an answer on June 15, 2026 at 8:24 pm

    demno: http://jsbin.com/welcome/61090

    <script type="text/javascript">
        $(function() {
            $('div.fadein  a:gt(0)').hide();
            setInterval(function() {
                $('div.fadein a:first-child').fadeOut().next('a').fadeIn().end().appendTo('.fadein');
            }, 1000);
        });
    
    </script>
    
    <style>
        .fadein a {
            position: absolute;
            left: 0;
            top: 0;
            display: inline-block;
        }
        .fadein {
            position: relative;
        }
        .fadein img, .fadein, .fadein a {
            width: 200px;
            height: 160px;
        }
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this line of code in an assembly: HttpContext.Current.Server.MapPath This works great if
I have this code running great in ff, opera and chrome: <script type=text/javascript> $(document).ready(function(){
I have been using this code with great success to pull out the first
I have some checkboxes bound to an array in my model. This works great,
I have a accepts_nested_attributes_for association between timesheet and timesheetlines. This works great, but when
hi all i have this great code that i love that will display the
I have this great pyodbc lib. I try the code below, it supposed to
I have this css code : http://lawb.co.il/style.css Which I use it for this site
I have this regex: {link=([^|{}]+)|([^|{}]+)|([^|{}]+)} this works great and returns me three groups between
i have this great code var percentColors = [ { pct: 0.0, color: {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.