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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:05:30+00:00 2026-06-09T07:05:30+00:00

I am using jquery.cycle image viewer A user clicks next or prev to scroll

  • 0

I am using jquery.cycle image viewer

A user clicks next or prev to scroll through the images

I need to know the image shown, and, for that value to be updated in a hidden form field so i can store the image the user has chosen.

this is cyle set up:

<script type="text/javascript">
$('#s2').cycle({ 
fx:     'fade', 
speed:  'normal', 
timeout: 0, 
next:   '#next2', 
prev:   '#prev2' 
});
</script>

What it does is shows images from a list, one at a time from within the container div – e.g.

<div id="s2" class="pics">
    <img src=http://blah.com/1.JPG>
    <img src=http://blah.com/2.JPG>
    <img src=http://blah.com/3.JPG>
    <img src=http://blah.com/4.JPG>
</div>

<div class="nav">
    <a id="prev2" href="#">Prev</a> <a id="next2" href="#">Next</a>
</div>

Is there a way to bind something onclick which can know the current image and then update a hidden field?

  • 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-09T07:05:31+00:00Added an answer on June 9, 2026 at 7:05 am

    Here you can find a reference to the options of the cycle plugin (or you can look at the source code).

    I think you want the after attribute:

    $('#s2').cycle({
       ...
       after: function(currSlideElement, nextSlideElement, options, forwardFlag){
        $('input:hidden').val(currSlideElement.val()); //this is probably an object so you'll need to console.log it to see how to get the value     }
    });
    

    please note that i’m not sure if the currSlideElement is an objetc or just an id, so just do a console.log on it to see its attributes.

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

Sidebar

Related Questions

I am using the jQuery cycle plugin to cycle through some images. These images
I'm using the jQuery Cycle plugin to cycle through some images on a webpage.
I'm using jQuery and cycle.js to fade through some images on this site. On
I am building a wordpress site using jQuery with cycle plugin to cycle through
I'm using the jQuery Cycle plugin to create an image slideshow. It works great,
I am using jquery cycle. It worked if it has multiple images. with one
I am using JQuery Cycle to produce a slideshow of images. The plugin uses
I am using the cycle jquery plugin. I have a few images that fade
Helo folks., i am using jquery.cycle plugin for displaying image gallery.. i have a
I'm using the JQuery Cycle Plugin in an attempt to fade in/out images for

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.