• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

slider doesn't work in ajax loaded content

Avast

👽 Chevereto Freak
I'm using the script of chevereto-docs to load my content (https://chevereto.com/community/threads/script-like-chevereto-docs.2869/)

Now i want to load content, which contains an image-slider (js http://codecanyon.net/item/royalslider-touchenabled-jquery-image-gallery/461126).
But i don't know how to connect the content-load-script with the call of the image-slider-function.
(The Slider works , when the content loads via php).
I tried (just for testing) to bind the call of the slider-function on a menu-item via jQuerys .click function (didn't work, only after clicking twice).

I think the best way , to call the function is, to implement the call into this function:

Code:
function loadDocs() {
    $(main_col).load('/content/docs_loader.php?page='+document.location.hash.replace('#!',''), function(response, status, xhr) {
        $('.loading').fadeOut(1000, function() { $(this).remove(); });
        var h2title = $(main_col+' h2').html();
        if (status == "error") {
            document.title = doctitle;
            $(main_col).html('404');
        } else {
            document.title = doctitle+' | '+h2title;
        }     
        _gaq.push(['_trackPageview', "/docs/?_escaped_fragment_="+normal_hash.replace('#','')]);
    }).hide().fadeIn('slow');
}

Does someone know how to deal with this problem?
 
When you load content, or you change the contents of a page using javascript, all the event listeners that doesnt use the .on() method won't work because the content has changed after the slider definition. I got the same problem with the script that formats the code (it puts colors and things like that). The solution is call this code in execution and in every instance that you use to add new content.
 
Back
Top