Portfolio with Flexslider Loading Speed

16 replies · opened Mar 22, 2023

PpardthemonsterMar 22, 2023

v6 had the ability do include:
``

This was needed on my portfolio page for instantaneous loading, otherwise flexslider required additional time and all items moved around after it was loaded.

v7 no longer has ability to include plugins.min.js, and I have lag with loading, visible on the flexslider items. I have tried specifying a few different javascripts in footer such as plugins.flexslider.js, trying to figure out what can speed things up, but have not had luck.

These are the comparisons in speed:

v6: https://www.aaronbonine.com/v6/portfolio.html

v7: https://www.aaronbonine.com/portfolio.html

Any idea what I can include in footer to replicate prior loading speed knowing that certain javascripts are needed for this Portfolio page with Flexslider?

SSemicolon WebSTAFFMar 22, 2023

Hello,

Please consider using this CSS instead and check if this resolves the reLayout issues:
[ch_pre type="css"]body:not(.has-plugin-flexslider) .grid-container {
align-items: stretch;
}[/ch_pre]

Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpardthemonsterMar 22, 2023

That did not seem to resolve the issue. v7 page has CSS noted above currently.

v6 refresh loading still much smoother when citing plugins.min.js in footer.

And for what its worth, this page also has similar lag on item Morning Dew and other Flexslider items:
https://canvastemplate.com/portfolio.html (v6.6.5 had plugins.min.js in footer and little lag)

Any other ideas?

SSemicolon WebSTAFFMar 22, 2023

Hello,

Consider using this code:
[ch_pre]

[/ch_pre]

Please do let us know if this works for you. We had decided for JS Async Loading to keep Page Speed in mind but we definitely understand that it differs from user to user.

So, we will work on alternate solutions.

SSemicolon WebSTAFFMar 23, 2023

We are sure we can fix this issue without needing to load all the Plugins on the Page. We have enough customization capabilities with the existing setup and event calls we can apply to make this work. Can you remove all the above codes we had provide and switch back to using just js/functions.js JS Linking and then consider using the following:

  1. Add the .customjs Class to the .grid-container DIV that holds the Portfolio.

  2. Add the following JS Code at the bottom of the Page:
    [ch_pre]
    window.addEventListener('pluginFlexSliderReady', () => {
    document.querySelectorAll('.grid-container').forEach(grid => grid.classList.remove('customjs'));
    SEMICOLON.Modules.gridInit();

    });
    [/ch_pre]

Let us know if this works for you.

PpardthemonsterMar 23, 2023

This seemed to work a little better and it appears key to get rid of scrambling the items related to flexslider was js/jquery.js removal. This version is here: https://www.aaronbonine.com/portfolio2.html, but not live yet per below.

Issues still: I do need jquery.js for the hash filter and another script I have to remove lightbox titles on hover. Further, it is still not as quick loading v6.6.5: https://www.aaronbonine.com/v6/portfolio.html (or the portfolio.html of v6.6.5 mentioned above)

Thanks for help so far and let me know if there is anything else I can try!

SSemicolon WebSTAFFMar 24, 2023

Hello,

We are working on a solution for this and will send you the files to test shortly. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

SSemicolon WebSTAFFMar 24, 2023

Hello,

Consider replacing the existing js/functions.js File with the one attached to this reply.

Then, use the following code at the bottom of your Page replacing the existing JS Linkings:
[ch_pre]

[/ch_pre]

Let us know if this works for you. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpardthemonsterMar 24, 2023

The updated functions.js file by itself DID resolve the initial scrambling during page load.

The two flexslider js files in footer further improve loading performance of the flexslider items, unfortunately not as quick as v6, but good enough for me.

Will the changes to the updated functions.js be included in future updates?

Thanks

SSemicolon WebSTAFFMar 24, 2023

Hello,

Thats great. Unfortunately, we are not sure why there is a delay but we will definitely investigate further.

Yes, this will be included in an update, but you will need to make a one-word change in the code in the js/functions.js File. You will just need to set jsLoadType: 'fn',. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

SSemicolon WebSTAFFMar 27, 2023

Hello,

You can consider removing the following code:
[ch_pre type="js"]$container.isotope({ transitionDuration: '0.65s' });[/ch_pre]

But please understand that these are Custom Solutions and currently this must be resolved manually. Since you are using IsoTope and the Filter Functionality, the reLayout of the Items will be evident when using Multiple JS Solutions together. Also, these would be currently considered as out of scope of support due to the amount of Customizations involved.

Thanks for Understanding.

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpardthemonsterMar 27, 2023

This also did not resolve jumping which was not present on v6.

I did not realize the out of box changes we were resolving were custom. Apologize if I am out of scope on support, but latest concern as it relates to page loading is part of default package in portfolio-hash-filter.html which includes:


	jQuery(window).on( 'load', function(){
		var $container = jQuery('#portfolio');

		$container.isotope({ transitionDuration: '0.65s' });

		function getHashFilter() {
			var hash = location.hash;
			// get filter=filterName
			var matches = location.hash.match( /filter=([^&]+)/i );
			var hashFilter = matches && matches[1];
			return hashFilter && decodeURIComponent( hashFilter );
		}

		var isIsotopeInit = false;

		function onHashchange() {
			var hashFilter = getHashFilter();
			if ( !hashFilter && isIsotopeInit ) {
				return;
			}
			isIsotopeInit = true;
			// filter isotope
			$container.isotope({ filter: hashFilter });
			// set selected class on button
			if ( hashFilter ) {
				jQuery('.grid-filter li').removeClass('activeFilter');
				jQuery('.grid-filter li').find('[data-filter="' + hashFilter + '"]').parent('li').addClass('activeFilter');
			}
		}

		jQuery(window).on( 'hashchange', onHashchange );
		// trigger event handler to init Isotope
		onHashchange();

		jQuery('.grid-filter a').click(function(){
			jQuery('.grid-filter li').removeClass('activeFilter');
			jQuery(this).parent('li').addClass('activeFilter');
			var selector = jQuery(this).attr('data-filter');
			$container.isotope({ filter: selector });
			var filterAttr = jQuery( this ).attr('data-filter');
			location.hash = 'filter=' + encodeURIComponent( filterAttr );
			return false;
		});
	});

Otherwise, my whole concern was loading performance and interface being that loading is much different than v6:
https://www.aaronbonine.com/v6/portfolio.html

SSemicolon WebSTAFFMar 28, 2023

Hello,

Thanks for Understanding. Canvas 6 and 7 are poles apart from each other. Some functionalities are handled differently. We will keep improving this with Future Updates.

Additionally, we try adding the Hash Filter with the Default Codes, so there will be no need to add any additional JS Codes on the Page which is causing this movement. We will let you know when this is available. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpardthemonsterMar 31, 2023

I was able to solve this by making portfolio items all lazy loaded. Please consider SOLVED. Thanks for all the help.

SSemicolon WebSTAFFApr 1, 2023

Glad the issue was resolved.

Please do let us know if we can help you with anything else.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard