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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:07:37+00:00 2026-05-13T14:07:37+00:00

I have a php array that gets returned from a database, the array contains

  • 0

I have a php array that gets returned from a database, the array contains paths to images that I want o make up the background of my wrapper div in my HTML, I want to be able to add some javascript that will cycle through the array and a set interval show the next image in the array, is this possible, and is it possible to also have some control over it so the user can skip back, forward and also stop the slidshow.

  • 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-13T14:07:37+00:00Added an answer on May 13, 2026 at 2:07 pm

    I’ve actually applied the jQuery Cycle plugin to do almost exactly what you’re asking. It’s a great and versatile plugin.

    I’m also pulling images out of an array to add to the page. The plugin grabs the images, hides what it doesn’t need and cycles through them.

    Update Just noticed you want the user to have control to move back and forth. Cycle does this as well. Have a look at the pager example.


    Re: Background Image Comment

    You just have to get a little creative. I’m not sure of a jQuery plugin that will fade a background image. I’m not sure that’s possible (if it is I’d love to see it). What I did instead is to absolutely position an element with a fixed size that acts as your container, matches the size of your background image and holds the cycle elements (which are positioned relatively inside). Add your page content by adding another absolutely positioned element right on top of the other one.

    Styles:

    #cycle, #content {
      position:absolute;
      top:0;
      left:50%; 
      width:800px;
      height:600px;
      margin-left:-400px; //middle of page
      z-index:1;
    }
    
    #content {
      z-index:100;
    }
    

    Javascript:

    $('#cycle') 
    .after('<div id="nav">') //needs some position styling
    .cycle({ 
        fx:     'fade', 
        speed:  'fast', 
        timeout: 0, 
        pager:  '#nav' 
    });
    

    html:

    <div id="cycle">
      <img src="path/to/image1.jpg" />
      <img src="path/to/image2.jpg" />
    </div>
    <div id="content">Hello World!</div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following php code that gets a serialized array from a mysql
I have the following php array that gets all values from a form full
I have a simple php file that gets info from mysql database display inside
So I have an array that gets created from a php loop that looks
I have an multi-dimensional array that I want to send to a PHP script
I have an array in php that contains all the lines of a text
I have a PHP file that contains a large array (about 90KB). I'm considering
So I have this function that gets data from database and echoes it. The
I have constructed a array that gets the information from checkboxes. This is working
I have a problem with an array that is getting returned from a query

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.