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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:19:15+00:00 2026-05-31T05:19:15+00:00

I am stumped and could really use some help with this gallery I’ve been

  • 0

I am stumped and could really use some help with this gallery I’ve been working on. I used Ivan’s ‘4 lines of jquery gallery’ tutorial to get me where I am at currently. Here’s his demo which shows exactly how it all works http://workshop.rs/demo/gallery-in-4-lines/

I’ve hit the point where I would like to include a previous and back button.

As the images are named ‘1-large.jpg’,’2-large.jpg’,’3-large.jpg’… etc I tried using the .slice() to take the first digit then add 1 or minus 1 to it, resulting in the next/previous pic but that didn’t work well at all as my javascript skills are lacking and I don’t even know if it’s the best way to approach it.

My question is – Is using .slice() the way to go or is there a more simpler code I can use on my buttons?

Any 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-31T05:19:16+00:00Added an answer on May 31, 2026 at 5:19 am

    If you just want the first character of a string:

    var name = "1-large.jpg";
    var i = name[0];
    // i is now '1'
    

    but this won’t work for i > 9, so using split would be better:

    var i = name.split('-')[0];
    // i is now '1'
    
    var i = "1023-large.jpg".split('-')[0];
    // i is now '1023'
    

    and to convert string to int:

    var num = parseInt("23", 10);
    // num is now the number 23, not a string
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this topic has been beaten into the ground, but I'm really stumped.
I'm totally stumped with this one and hope someone could help me out here:
This really has my stumped today. I'm sure its simple, but... Here is my
I've been stumped with some SQL where I've got several rows of data, and
I'm really stumped on this issue. I have a problem where Java can't find
I would be very grateful if anyone could help me out with this problem.
I am really stumped on this one. I have a simple python wrapper which
I am kind of stumped with this one, and was hoping I could find
I have been stumped on this for a long time and I was wondering
This has been a hard problem to diagnose and I was hoping someone could

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.