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 7580641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:58:05+00:00 2026-05-30T17:58:05+00:00

Hi I am a beginner jQuery user and I am trying to create a

  • 0

Hi I am a beginner jQuery user and I am trying to create a cross fading efect but it seems I cant seem to select the corect element.This is my code:

<ul id="slideimage">
    <li ><img src="img/slider/pic/slide01.jpg" alt="img" class="active"/></li>
    <li><img src="img/slider/pic/slide02.jpg" alt="img" /></li>
    <li><img src="img/slider/pic/slide03.jpg" alt="img"/></li>
    <li><img src="img/slider/pic/slide04.jpg" alt="img"/></li>
    <li><img src="img/slider/pic/slide05.jpg" alt="img"/></li>
    <li><img src="img/slider/pic/slide06.jpg" alt="img"/></li>
</ul>

ul#slideimage li img{
          position: absolute;
          width:100%;
          height: 500px;
          z-index: 0;
            }
ul#slideimage li img.active{
          z-index: 10;
            }

(function(){
      setInterval("slideshow()" , 2000);
})();   

function slideshow(){
             var $first = $('ul#slideimage li img:first');
             var $active = $('ul#slideimage  li img.active');
             var $next = $active.next('ul#slideimage li img').length ? $active.next('ul#slideimage li img'): $first;
                        console.log($next);

                        $active.animate({'opacity':'0'},1000,function(){
                            $(this).removeClass('active').css({'opacity':'1'});
                        });
                        $next.addClass('active');
                    }

What is the problem with the code that it keeps fading out the first image and then making it appear again.I think I am not managing to target the next element correctly but I have been trying to do this for the last 3 hours with no success.Some help would be much appreciated.

  • 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-05-30T17:58:06+00:00Added an answer on May 30, 2026 at 5:58 pm

    You have quite a few syntax errors in the code structure provided but see below:

        <style>
        ul#slideimage li img{
            position: absolute;
            width:100%;
            height: 500px;
            z-index: 0;
        }
        ul#slideimage li img.active{
            z-index: 10;
        }
        </style>
        <script type="text/javascript">
            var counter=0;
            function slideshow(){
                var total = $('ul#slideimage li img').size();
                var $active= $('ul#slideimage li img');
                $active.filter(function(index){return index== counter % total})
                .animate({'opacity':'0'},1000,function(){
                    $(this).css({'opacity':'1'});
                });
                counter++;
            }
    
    
            $(function() {                  
                slideshow();                
                setInterval(slideshow, 2000);
            });
        </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a COMPLETE beginner at JQuery (and javascript in general) but I'm having
I'm a jQuery beginner, but I need to style the front-end of a CMS
I'm a jQuery beginner. I'm trying to code a very simple using $.get(). The
I'm a beginner jquery user so I'm really hoping this will be quite straight
I am jQuery beginner :) I am trying to move from left to right
I am a beginner at jQuery. I am trying to practice as many functions
I am a beginner with jQuery and I am trying to modify a script.
I am an absolute beginner to jQuery and json, and I am trying to
I'm a javascript/jquery beginner. I'm trying to gray out, disable, and change the background
Hi i want to get changed text value from JQuery but i can't select

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.