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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:30:27+00:00 2026-06-15T12:30:27+00:00

I am trying to reinitialize FlexSlider with out page refresh when a new gallery

  • 0

I am trying to reinitialize FlexSlider with out page refresh when a new gallery listing is called asynchronously.

I would think the routine below would work but it doesn’t. It seems like the first FlexSlider persists even though the new images are successfully loaded.

Is there a way to destroy, then rebuild the gallery?

Thanks

function flexInit() {
        $('.flexslider').flexslider({
            animation: "slide",
            controlsContainer: ".paginator",
            manualControls: 'a',
            after: function(slider){
                if(slider.atEnd == true)    {
                    // ??? slider.destroy;
                    galBuild();
                }
            }
        });
    }

    function galBuild() {
            $.getJSON("/gallery/next/"+galID, function (data) {
            var results = data.objects;
            var list = $(".flexslider ul.slides");
            var i = 0;
            $.each(results, function () {

                list.append('<li><p>' + results[i].title + '</p><img src="' + results[i].src + '"><p class="flex-caption">' + results[i++].caption + '</p></li>');

            });

            flexInit(); 

            });
    }

    galBuild();
  • 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-15T12:30:29+00:00Added an answer on June 15, 2026 at 12:30 pm

    i’m using different approach i.e.

    you’ve started one flexslider:

    
        $('#element).flexslider({
          animation: "slide",
          controlNav: false,
          directionNav: true
        });
    
    

    when I want to change slides in previously created slider and restart it, id do following things:

    • creating temporaty div:

      $('#element).before('
          <div id="element_temp" class="flexslider"></div>
      ');
      
    • delete div with previously created slider

      $('#element).remove();
      
    • insert new list of slides into temporary div:

      var html = `
      <ul class='slides">
      <li><img src="link to image" /></li>
      <li><img src="link to image" /></li>
      <li><img src="link to image" /></li>
      </ul>`;
      $('#element_temp').html(html);
      
    • start flexslider on temp div

      $('#element_temp').flexslider({
        animation: "slide",
        controlNav: false,
        directionNav: true
      });
      
    • change div ID from element_temp to element

      $('#element_temp').attr('id','element');
      

    and it works with multiple flexliders

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

Sidebar

Related Questions

Trying to build out an exception if move.UserId does not equal currentUserId then Redirect
Trying to figure out how I can do this properly. The print_r looks like
trying to figure out why this is happening - I have an input text
I have a simple HTML page (ratings.html) that I'm trying to test using HtmlUnit.
I am trying to build on the WebSharingAppDemo-SqlProviderEndToEnd msdn sample application to build out
Trying to figure out why my vertex shader works on my cell phone (Casio
Trying to load a page fragment, or at least jump to a div but
I'm trying to get JScrollPane to reinitialize on expand/collapse of my accordion found here
Trying to figure out why it is NULL. I was expecting 7 to be
I am trying to figure out how to control the lifetime of a TISAPIApplication

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.