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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:20:37+00:00 2026-05-26T09:20:37+00:00

Simple question and easy points for a kind soul who helps a novice. I’m

  • 0

Simple question and easy points for a kind soul who helps a novice.

I’m using WordPress, jQuery is properly loading in the header.

I’ve got a ul with a 1600x2000px bg-image. I’d like to change the background-position by -500px to create a sliding effect like an ad board in a shopping mall. If it’s the :last-child, instead of -500, it will +1500 (roll back to the top) but I think I can handle the if/else on my own, just having trouble getting .animate() going.

HTML

<ul id="indexSlides">
    <li id="messageBox">
    </li>
    <li id="slideA">
      <p>Some Text</p>
    </li>
    <li id="slideB">
      <p>Some more Text</p>
    </li>
    <li id="slideC">
      <p>Some different Text</p>
    </li>
    <li id="slideD">
      <p>Some Text</p>
    </li>
</ul>

CSS:

ul#indexSlides {
    height: 500px;
    background: url('images/slides.jpg') 0 0 no-repeat transparent;
}

ul#indexSlides > li > p {
    display: none;
}

jQuery:

<script type="text/javascript">

// function to slide the background of the list

jQuery(document).ready(function($) {

setInterval(function() {
    $("#indexSlides").animate({
        top: '-=500',
    } , {
        duration: 1500,
    }
}, 5000),
});

</script>

Thanks in advance for any help.

  • 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-26T09:20:37+00:00Added an answer on May 26, 2026 at 9:20 am

    You’re missing a paren, there’s an extra comma or 2, and a comma instead of a semi-colon:

    jQuery(document).ready(function($) {
       setInterval(function() { 
        $("#indexSlides").animate({
                top: '-=500'
            } , {
                duration: 1500
            });
        }, 5000);
    });
    

    EDIT:
    Here’s an example using 2 divs: http://jsfiddle.net/fehays/yXLv3/1/

    The inner div is the height of the entire background image. The outer div has a height of one single slide and a overflow:hidden so you only see one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question, (Easy points!) In Delphi 2010 (with updates 4 and 5) Find in
Simple question, (Easy points!) In Delphi 2010 (with updates 4 and 5) Find in
My question is quite simple and with the SharpSvn Api, it should be easy
Simple question: Is there a class or interface that encapulates the getting of a
Simple question, I would like to append text to the front of every print
Simple question - How do I convert a string that has been through parseInt
Simple question, could'nt find a straight answer. How can I modify the output file
Simple question: does the Java memory/synchronization model guarantee atomic pointer writes? That is, if
Simple question: I call: DateTime.TryParseExact(May 16 13:47:12 2012, MMM dd hh:mm:ss yyyy, System.Globalization.CultureInfo.GetCultureInfo(en-US), DateTimeStyles.None,
Simple question to which I can't find any nice answer by myself: Let's say

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.