Home Forums Basel support forum How to prevent "jump-load" when loading home page first time

How to prevent "jump-load" when loading home page first time

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37897

    vinirossi
    Participant

    I have noticed that page loading does not look elegant on home page especially when using a slider (in the header). Although slider revolution has a built-in preloading feature, the page load jumps. This means: first the lower sections of the page are loaded and shown then slider revolution loads, preloading is shown (with preloading spinner) and then the whole slider is loaded inclusive compressed jpges.

    How could I force to load first slider and then the rest of the page? Or better: How to include a full page preloading? I have bad experience (in SEO) with full page ajax loading plugins though…

    #37933

    Artem Temos
    Keymaster

    Hi,

    Unfortunately, there is no way to force the Revolution Slider loads first. You can try to set the fixed height for the slider to avoid this jump on page loading.

    Regards

    #37972

    vinirossi
    Participant

    Thanks. How have your resolved this on your demos?

    #38025

    Artem Temos
    Keymaster

    This problem exists on our demo as well. Try to set the fixed height for the slider to fix this.

    #38088

    vinirossi
    Participant

    Could not resolve this with fixed height.

    Used Revolution Slider API instead:

    //Set .site-content invisible to make "jump invisible"

    jQuery(document).ready(function($) {
    	//Hide jumping content above Slider
    	$(".site-content").css('visibility', 'hidden');
    });
    //Set .site-content visible on slider event "loaded"
        revapi19.bind("revolution.slide.onloaded",function (e) {
    		console.log("slider loaded");
    		jQuery(".site-content").css('visibility', 'visible');
    	});
    #38109

    Artem Temos
    Keymaster

    Great, we are glad that you have found the solution.

    #38149

    vinirossi
    Participant

    Better Fix:

    In functions.php:

    add_filter( 'body_class','my_body_classes' );
    function my_body_classes( $classes ) {
     
        if ( is_front_page() ) {
         
            $classes[] = 'has-revolution-slider';
             
        }
         
        return $classes;
         
    }

    In custom stylesheets:

    body.has-revolution-slider .site-content {
      visibility: hidden;
    }

    In Slider Revolution Slider Settings at Custom Javascript:

    revapi19.bind("revolution.slide.onloaded",function (e) {
    		console.log("slider loaded");
    		jQuery(".site-content").css('visibility', 'visible');
    	});

    Replace revapi19 with your relevant slider variable (See within Slider Settings)

    #38205

    Artem Temos
    Keymaster

    Thank you for sharing your experience here.

Viewing 8 posts - 1 through 8 (of 8 total)