• Resolved robwent

    (@robwent)


    We have a custom thtme that uses pjax for partial page loading, so all the js and css needs to be in the theme files that get loaded on every page.

    Is there an easy way to unhook the plugins files and move them to the theme or is this more complicated than it sounds?

    I assume each slideshow has some inline script as well.

    Thanks for any pointers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author averta

    (@averta)

    Hi,

    Maybe unhooking and re-hooking main styles and scripts be easy, but each slider has unique scripts that needed to initiate the slider.

    Also you maybe need to update assets after each plugin update.

    If you want to fix the conflict with ajax page loading and Master Slider, there is some easier ways to fix that.

    Let us know if you have any further questions.

    Regards
    Averta

    Thread Starter robwent

    (@robwent)

    What are the easier ways to fix it?

    I’ve turned off pjax for now.

    Plugin Author averta

    (@averta)

    Hi,

    Sorry about the delay in responding.

    Master Slide set size for images and elements in slider while initiating slider. When the parent element of slider or slider wrapper isn’t displaying on the page (like using slider under tabs, loading slider with ajax and etc. ) the slider can’t size images and elements correctly. So you need to force to update slider after ajax loading finished or tab clicked.

    Currently, Slider will update itself while browser resizing. So even slider loaded with ajax, it will show correctly after resizing browser.

    There is a sample code that updates slider and thumbnails after click. By making some simple changes, you can use it for updating slider after ajax loading.

    jQuery(".custom-selector").bind("click", function(){
        setTimeout( function() {
            jQuery.each(masterslider_instances, function(i, slider) {
                slider.api.update();
                slider.api.__resize(true);
                jQuery.each(slider.controls, function( index, control ) {
                    if (control.realignThumbs) control.realignThumbs();
                } );
            });  
        },600 );
    });

    Notes: Set time out is custom and in this case we assumed that there is a fade effect and showing slider takes about 600 ms of times.

    Hope to it makes sense.

    Regards
    Averta

    Thread Starter robwent

    (@robwent)

    Thank you!

    I’ve will give it a test.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Move js and css to theme’ is closed to new replies.