Home Forums Porto Template Pictures display problem in the gallery

This topic contains 2 replies, has 2 voices, and was last updated by  Murgi 6 days, 12 hours ago. This post has been viewed 25 times

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10028535

    Murgi
    Participant

    Hello Rodrigo,

    Can you please check why the images are not displayed immediately after page loading in the gallery? Only after clicking the SHOW ALL button.

    Thank you
    Murgi



    Template Version: 7.1.0
    #10028545

    Support2
    Keymaster

    Hello Murgi,

    This occurs because of the URL hash change conflict between the “Section Scroll” and “Sort Gallery”. Note that the hash on URL changes when you scroll between sections and when click on the filters of gallery.

    We can fix that with this simple code below at (js/custom.js):

    $.extend(theme.PluginSectionScroll.prototype, {
    	updateHash: function( first_load ){
    		var self = this;
    
    		if( !window.location.hash ) {
    			window.location.hash = 1;
    		} else {
    			if(!first_load) {
    				var $section = $('.section-wrapper').eq( self.getCurrentIndex() ).find('.section-scroll'),
    					section_id = $section.attr('id') ? $section.attr('id') : $section.parent().index() + 1;
    
    				window.location.hash = section_id;
    			}
    		}
    
    		if( window.location.hash == '#7' ) {
    			setTimeout(function(){
    				$('.sort-source li:nth-child(1) > a').trigger('click');
    			}, 1000);
    		}
    
    		return this;
    	}
    });

    – Basically the code above will trigger a click event on the gallery filter “Show All” when it’s on the section #7.
    – The #7 on the code above is the number of section that contains the image gallery with filters.

    Hope it helps.

    Kind Regards,

    Rodrigo.


    #10028561

    Murgi
    Participant

    Hi Rodrigo,

    Yeah it works.
    I am very grateful.

    Thank you
    Murgi


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