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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:34:45+00:00 2026-06-18T15:34:45+00:00

I want to make something similar to an image slider. The same logic that

  • 0

I want to make something similar to an image slider. The same logic that goes into a slider is something I need a lot. I know a million plugins and tutorials exist but what I want is to learn from basic jQuery patterns like the ‘slider’ or ‘accordion’ without any of the fluff. I want to look over very basic jQuery patterns to learn from.

Would one of the patterns found in the JavaScript Pattern Collection be what I am looking for?

  • 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-18T15:34:47+00:00Added an answer on June 18, 2026 at 3:34 pm

    There is not enough logic in an image slider to warrant a proper software design pattern.

    Having a look at your link, many of these are not patterns but simply descriptions of things you can do in javascript

    For the image slider itself let’s look at it in two components:

    User interaction component: buttons (prev, next) or slider

    Image component: display image currently selected

    All you really have to do is store the index of the currently selected image and lookup what x position to slide the image slider to when you select that image.

    Here is a rough example:

    http://jsfiddle.net/mattdlockyer/bNnEw/

    You’ll see that it’s mostly a functional loop in the beginning that’s doing all the leg work and storing the correct indexes to slide the #images div to using the animate function in jQuery. This is called when the user interacts with the buttons but just as easily could be called when a slider fires it’s slide event. See here for more info on sliders: http://jqueryui.com/slider/

    Personally I would take all this functional programming and put it into a proper javascript module. Check out this link for a great example of how to use the module pattern: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth

    Basically the concept of an image slider alone does not warrant a pattern, but the utility of wrapping it up in a module so that it is reusable, perhaps even several times on the same page, is definitely worth doing.

    Javascript is a functional language and there are a lot of “patterns” for writing clean, portable, functional code but they don’t equate to OOP design patterns IMHO.

    Enjoy the fiddle, hope this helps you in your javascripting adventures.

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

Sidebar

Related Questions

I want to make something similar to the listbox.children property. I know I can
I want to make something similar to the CSS/JQUERY effect that you can see
I have an object with event handlers and I want to make something similar
I want to make something that makes much sense, but I think its not
what is wrong with this code? I want to make something similar to looped
I want to use in my application UISegmentedControl, to make something similar to TabBar
I want to know how to make something like this: example: <a href=# id=123>Link</a>
I'm trying to make something similar to an array. I need to be able
I want to make something like this... :LoopBegin if ???? goto End some other
First of all, I want to make something clear before I get yelled at:

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.