Portfolio – Remove ALL

  • Posted in : Responsy WP
  • ismacuasni
    Participant

    Hi,

    Its posible remove the filter ALL and open the first item?

    See: http://www.plafo.com/new/?page_id=55

    Thanks!

    Ismael

    ahmetsali
    Keymaster

    Hi, paste the code below to the “External Stylesheet / Javascript” box under Theme Settings > Style;

    <script>
    $(function() {
       $('#filters li').first().remove();
       $('#filters li').first().find('a').trigger('click');
    });
    </script>
    
    ismacuasni
    Participant

    Perfect!, but… I see all thumbails in the right (sorry my english)

    http://www.plafo.com/new/?page_id=55

    Thanks a lot!

    Ismael

    Mehmet S.
    Keymaster

    Hi, update the code;

    <script>
    $(function() {
       $('#filters li').first().remove();
       setTimeout(function() { $('#filters li').first().find('a').trigger('click')}, 1000);
    });
    </script>
    
    ismacuasni
    Participant

    I update the code but not working. See: http://www.plafo.com/new/?page_id=55

    ahmetsali
    Keymaster

    Hi, try this one;

    <script>
    $(function() {
       $('#filters li').first().remove();
       $('#portfolio').waitForImages(function() {
          setTimeout(function() { $('#filters li').first().find('a').trigger('click')}, 1000);
       },null,true);
    });
    </script>
    
    ismacuasni
    Participant

    Works! But… before loading all images, not only of Alb

    ismacuasni
    Participant

    is posible not wait for Images and only load the first images of the first departament?

    ismacuasni
    Participant

    Do you see this problem http://www.plafo.com/new/?page_id=55

    I do not want to wait until the images are loaded. Because the website becomes slow. I want to load only the images of the first department.

    Please helpme.

    Thanks

    Ismael

    ahmetsali
    Keymaster

    Hi, i see, update the code as;

    <script>
    $(function() {
    
       $('#filters li').first().remove();
       $('#filters li').first().addClass('current');
    
      //**********************************
      // PORTFOLIO FILTERING - ISOTOPE
      // cache container
      var $container = $('#portfolio');
      var $firstFilter = $('#filters li.current a').attr('data-filter');
      var $firstCategory = $container.find('.item' + $firstFilter);	
      if($container.length) {
    
       $container.find('.item:not(' + $firstFilter + ')').hide();
       
       $firstCategory.waitForImages(function() {
    
         //initialize isotope
         $container.isotope({
    	itemSelector : '.item',
    	layoutMode : 'fitRows',
            filter : $firstFilter
         });    
        
         $container.find('.item:not(' + $firstFilter + ')').show();  
       
       },null,true);
       }
       //**********************************
    
    });
    </script>
    
    ismacuasni
    Participant

    You are the best!

    Thanks a lot!

    Ismael

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

The forum ‘Responsy WP’ is closed to new topics and replies.