• Anasayfa
  • .
  • Blog
  • .
  • Twentytwenty.js Not Appearing on First Load

Twentytwenty.js Not Appearing on First Load

Twentytwenty.js Not Appearing on First Load

TwentyTwenty.js before / after javascript plugin that we all use in our term projects

However, there is a problem faced by many of our friends and its solution is; We will fix it with the following codes.

This problem is related to before / after images not showing when the page is first loaded. To test this problem, you can CTRL+F5 in the Chrome browser and reload the resources and test.

If the images are not loading, are not displayed, if the codes are not working, you are suffering from the same problem.

To resolve it, all we need to do is add the following code to the bottom of the javascript codes.</p >

$(document).ready(function() {
	$("img").load(function(){
	$(window).trigger("resize.twentytwenty");
	});
			     
});

When images are uploaded with these codes, the plugin has been triggered and we will fix the error.

Türkçe English Deutsch Dansk Español Română