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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:01:52+00:00 2026-06-09T22:01:52+00:00

I am creating one website that uses CSS3 fullscreen gallery. Basically, when i change

  • 0

I am creating one website that uses CSS3 fullscreen gallery. Basically, when i change images my website’s address changes. For example, http://www.mysite/index.html#image7 or http://www.mysite/index.html#image20.

I would need a way to display a random image on page load with jQuery or pure JS. I can point to an exact image easily with having this line inside document ready function:

document.location.href = "http://www.mysite/index.html#image13";

I am not so good with JavaScript, but maybe creating some array of images and then using some randomize function would do the trick?

Any advice?

  • 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-09T22:01:57+00:00Added an answer on June 9, 2026 at 10:01 pm

    Ok, i managed to do it myself. I stored some values into an array, and then just used it with document.location.href

        var images = [],
            index = 0;
    
            images[0] = "http://www.mysite/index.html#image13";
            images[1] = "http://www.mysite/index.html#image17";
            images[2] = "http://www.mysite/index.html#image5";
    
            index = Math.floor(Math.random() * images.length);
    
            document.location.href = images[index];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a web-page/website that integrates all my accounts into one spectrum, as
I m creating a Website as Static HTML pages. In that only in one
So I'm creating a website that has all of its content in one centered
I read from sun website that for every reference jvm is creating one immutable
So I am creating a website using Django templates, forms etc. One thing I've
I am creating one asp page. In that page i defined one property like
I've creating one ASP web application, in that application one form have to update
I have my website that I am creating here and it's looking good (right
I'm creating a website that will be in English, Chinese and Korean. There are
I am creating a website that will allow people to make lists, but I'm

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.