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

  • Home
  • SEARCH
  • 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 8537825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:59:30+00:00 2026-06-11T10:59:30+00:00

I am making a picture preview with jCarousel (http://sorgalla.com/projects/jcarousel/), but faced with one problem:

  • 0

I am making a picture preview with jCarousel (http://sorgalla.com/projects/jcarousel/), but faced with one problem: I do not know how could I reload/refresh jCarousel dynamic list.

I have few categories of images. When I click on a picture in one of that, I need that the list would be created and preview start with that element. I have some code, but do not know how to make it re-create all list after clicking on other image that preview start with other image.
Here are my code:

$(document).ready(function(){
$("ul#stage li").live('click', function() {

    var ul = $(this).parent();
    var index = +(ul.children().index(this))+1;

    var mycarousel_itemList = [ ];

    $('li[data-id]').each(function () {
        var $this = $(this);
            mycarousel_itemList.push({
                url : $this.attr("data-img"),
                title : $this.attr("data-title")
            });
    });

    function mycarousel_itemLoadCallback(carousel, state) {
        for (var i = carousel.first; i <= carousel.last; i++) {
            if (carousel.has(i)) {
                continue;
            }
            if (i > mycarousel_itemList.length) {
                break;
            }
            carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
        }
    };

    function mycarousel_getItemHTML(item) {
        return '<img src="' + item.url + '" width="800" height="600" alt="' + item.url + '" />';
    };
        alert(index);
    jQuery('#mycarousel').jcarousel({
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback},
        size: mycarousel_itemList.length,
        scroll: 1,
        start: index,
        wrap: 'last',
        animation: 'fast',
        visible: 1
    });

    document.getElementById('popup-content').style.background='url('+$(this).attr("data-img")+') no-repeat center';
    document.getElementById('fades').style.display='block';
    document.getElementById("light").style.display = "block";
    $("#light").fadeTo("slow", 1);
});
});

Everything is like that: there are images > I click on one of those > popup shows with jCarousel and one visible image and then I could scroll through all other images.

It is working good, but just a first time. When I click on other image (after closing popup), the view starts with that image which was opened last.

If something are not clear enough – please, ask. I will try to make it more precisely.
Thanks for your help!

  • 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-11T10:59:31+00:00Added an answer on June 11, 2026 at 10:59 am

    You can recreate jCarousel, first use $(‘#mycarousel’).remove(); and next init jCarousel again. I didn’t really understand what you’re trying to do, but this can help in most cases, of course jCarousel should have Destroy method but it hasn’t.

    And why you don’t use jquery selectors in some cases?

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

Sidebar

Related Questions

I'm following this tutorial on making an animation like IKEA: http://static.buildinternet.com/live-tutorials/interactive-picture/index.html The issue I'm
I am making a website http://projects.knord.dk/grjenie31/home.aspx And in IE 9 I see white lines
I'm making a picture preview of a link typed in a text box. jQuery
i have written alot of description but i figured making a picture will make
i have a question regarding an gallery/picture tag app im making for a course.
I am making a game. The following should draw me a picture of c.png
Making a new site but something is happening to it in IE8. The social
Making a new site but something is happening to it in IE. I've purchased
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
This picture shows what i want , i just making a custom movieplay controller.

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.