Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #1293792

    Hi,
    I have a Question, if is possible to put two functional arrows in the Tab Section ?

    Thanks!
    example

    • This topic was modified 3 years, 8 months ago by reinkieker.
    #1293980

    Any suggestions?

    Thanks!

    #1293995

    I found this Code , it works , the arrows are there.
    But dont work it when i click it
    How can i change it , the correctly use?

    /* Arrow tabs section. */
    .av-tab-section-outer-container:after, .av-tab-section-outer-container:before {
    font-family: ‘entypo-fontello’;
    font-size: 60px;
    position: absolute;
    top: 300px;
    z-index: 1000;
    padding: 30px 15px 30px 15px;
    background: ;
    -webkit-transition: all 0.4s ease-out;
    -moz-transition: all 0.4s ease-out;
    transition: all 0.4s ease-out;
    color: grey!important;
    pointer-events:none;
    }
    .av-tab-section-outer-container:after {
    content: ‘\e879’;
    right: 20px;
    }
    .av-tab-section-outer-container:before {
    content: ‘\e878’;
    left: 20px;
    }
    .av-tab-section-outer-container.av-start:before, .av-tab-section-outer-container.av-end:after {
    opacity: 0;
    visibility: hidden;
    }

    Php

    function tab_section_arrows(){
    ?>
    <script>
    (function( $ ) {
    var $ts = $(‘.av-tab-section-outer-container’);
    var $tab = $ts.find(‘.av-section-tab-title’);

    getActiveTab();

    $tab.on(‘mouseup’, function() {
    setTimeout(getActiveTab, 100);
    });

    function getActiveTab() {
    if( $tab.first().hasClass(‘av-active-tab-title’) ) {
    $ts.addClass(‘av-start’);
    $ts.removeClass(‘av-end’);
    } else if ( $tab.last().hasClass(‘av-active-tab-title’) ) {
    $ts.addClass(‘av-end’);
    $ts.removeClass(‘av-start’);
    } else {
    $ts.removeClass(‘av-start’);
    $ts.removeClass(‘av-end’);
    }
    }

    }(jQuery));
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘tab_section_arrows’);

    #1294505

    Hi,

    Thank you for the inquiry.

    Try to use this script instead in the functions.php file to create a navigation inside the tab section element. You have to remove the previous script and styles, and adjust the appearance of the previous and next buttons.

    function ava_tab_section_arrows(){
    ?>
    <script>
    (function($) {
        if($(".av-tabsection-navs").length == 0) {
            $(".av-tab-section-container").prepend("<div class='av-tabsection-navs'><div class='av-tabsection-nav-prev'>Prev</div><div class='av-tabsection-nav-next'>Next</div</div>")
        }
    
        $(".av-tabsection-navs div").on("click", function(e) {
            if(e.currentTarget.classList.contains("av-tabsection-nav-prev")) {
                $(".av-active-tab-title").prev().trigger("click");
            }
    
            if(e.currentTarget.classList.contains("av-tabsection-nav-next")) {
                $(".av-active-tab-title").next().trigger("click");
            }
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘ava_tab_section_arrows’);
    

    Best regards,
    Ismael

    #1294549

    Hi,
    thanks for the Help.
    I just put the Code in the functions.php file but unfortunately don’t work.
    I see the Arrows but still don’t working.
    Any Suggestions?
    Thanks!

    #1294967

    Hi,

    Please try this instead:

    function ava_tab_section_arrows(){
    ?>
    <script>
    (function($) {
        if($(".av-tabsection-navs").length == 0) {
            $(".av-tab-section-container").prepend("<div class='av-tabsection-navs'><div class='av-tabsection-nav-prev'>Prev</div><div class='av-tabsection-nav-next'>Next</div</div>")
        }
    
        $(".av-tabsection-navs div").on("click", function(e) {
            if(e.currentTarget.classList.contains("av-tabsection-nav-prev")) {
                $(".av-active-tab-title").prev().trigger("click");
            }
    
            if(e.currentTarget.classList.contains("av-tabsection-nav-next")) {
                $(".av-active-tab-title").next().trigger("click");
            }
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_tab_section_arrows');

    Best regards,
    Rikard

    #1294988

    Hi,

    I just put the new Code in the functions.php i only see the “previos” und “next” text in the left corner, its works i think but, how can i edit it?
    and put it in the left and right side like the arrows?
    Thanks again
    Any Suggestions?

    • This reply was modified 3 years, 8 months ago by reinkieker.
    #1295004

    And that function does not include the case if there are more than one tab-section on that page!

    #1295116

    Hi,

    Thank you for following up.

    You can use the .av-tabsection-nav-prev and .av-tabsection-nav-next selectors to style the navigation. Example:

    .av-tabsection-nav-prev, .av-tabsection-nav-net {
       position: absolute;
       color: red;
       top: 100px;
    }
    
    .av-tabsection-nav-prev {
       left: 20px;
    }
    
    .av-tabsection-nav-next {
       right: 20px;
    }

    @Guennie007: We could check for the parent container and find the active tab from there instead of directly using the .av-active-tab-title selector.

    Best regards,
    Ismael

    #1295297

    i did it this way – an for simplicity reasons i only take html entities to form the arrows:
    this to child-theme functions.php

    function ava_tab_section_arrows(){
    ?>
    <script>
    (function($) {
        $('.av-tab-section-container').each(function() {
            $(this).find('.av-tab-section-outer-container').prepend("<div class='av-tabsection-navs av-tabsection-nav-prev'>&lang;</div><div class='av-tabsection-navs av-tabsection-nav-next'>&rang;</div>");
            var arrowColor = $(this).find('.av-tab-section-tab-title-container').css('background-color');
            $(this).find('.av-tabsection-navs').css('color', arrowColor);
    
            var that = this;
            $('.av-tabsection-nav-prev', this).on('click', function(){	
            	$(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').prev().trigger('click');  
            });
            $('.av-tabsection-nav-next', this).on('click' , function(){	
                $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').next().trigger('click');
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_tab_section_arrows');

    this to quick css:

    .av-layout-tab .container {
      padding-left: 100px;
      padding-right: 100px;
    }
    .av-tabsection-navs {
      opacity: 0.1;
      position: absolute;
      top: 55%;
      cursor: pointer;
      z-index: 5;
      font-family: arial;
      font-size: 40px;
      font-weight: bold;
      color: #333;
      height: 40px;
      width: 40px;
      transition: all 1s ease
    }
    .av-tab-section-outer-container:hover .av-tabsection-navs {
      opacity: 1;
      transition: all 1s ease;
      text-shadow: 8px 1px 5px #aaa;
    }
    .av-tab-section-outer-container:hover .av-tabsection-navs {
      transition: all 1s ease;
      transform: scale(1.5);
    }
    .av-tabsection-navs.av-tabsection-nav-prev {
      left: 0;
      text-align: right;
    }
    .av-tabsection-navs.av-tabsection-nav-next {
      right: 0;
      float: left;
    }
    @media only screen and (max-width:767px)  {
      .responsive #top #wrap_all .av-layout-tab .container {
        padding: 0 30px;
      }
      .av-tabsection-navs {
        width: 25px;
      }
    }

    Result page: https://webers-testseite.de/tab-section/
    If your tab-title background is white – overwrite the calculated color of the arrows by css with important.

    • This reply was modified 3 years, 8 months ago by Guenni007.
    #1295305

    Hello,
    finally works perfect!
    Thanks so much !

    #1295357

    One thing to mention – of course, you shouldn’t set up the hover styles, because the mobile devices don’t support that.
    So either you hide these arrows then – or you have to set up the settings for avia_desctop class only and leave the opacity at 1 for the avia_mobile.
    Sorry

    f.e.:

    .avia_mobile .av-tabsection-navs {
        opacity: 1;
    }
    #1295694

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1295715

    by the way – loop these arrows
    if the first tab is shown and you click to the left side the last sibling tab is shown – rotation like in post navigation:

    function ava_tab_section_arrows(){
    ?>
    <script>
    (function($) {
        $('.av-tab-section-container').each(function() {
            $(this).find('.av-tab-section-outer-container').prepend("<div class='av-tabsection-navs av-tabsection-nav-prev'>&lang;</div><div class='av-tabsection-navs av-tabsection-nav-next'>&rang;</div>");
            var arrowColor = $(this).find('.av-tab-section-tab-title-container').css('background-color');
            $(this).find('.av-tabsection-navs').css('color', arrowColor);
    
            var that = this;
            $('.av-tabsection-nav-prev', this).on('click', function(){  
              if($(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').prev().length){
                $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').prev().trigger('click'); 
              }
              else{
                $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').siblings(":last").trigger('click');
              }
            });
    
            $('.av-tabsection-nav-next', this).on('click' , function(){ 
              if($(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').next().length){
                $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').next().trigger('click');
              }
              else{
                $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title').siblings(":first").trigger('click');
              }
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_tab_section_arrows');
    #1295725

    or with ternary operators a little shorter:

    function ava_tab_section_arrows(){
    ?>
    <script>
    (function($) {
    $('.av-tab-section-container').each(function() {
    	$(this).find('.av-tab-section-outer-container').prepend("<div class='av-tabsection-navs av-tabsection-nav-prev'>&lang;</div><div class='av-tabsection-navs av-tabsection-nav-next'>&rang;</div>");
    	var arrowColor = $(this).find('.av-tab-section-tab-title-container').css('background-color');
    	$(this).find('.av-tabsection-navs').css('color', arrowColor);
    
    	var that = this;
    	$('.av-tabsection-nav-prev', this).on('click', function(){ 
    		var activeElement = $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title');
    		activeElement.prev().length ? activeElement.prev().trigger('click') : activeElement.siblings(":last").trigger('click');
    	});
    	$('.av-tabsection-nav-next', this).on('click' , function(){ 
    		var activeElement = $(this).closest('.av-tab-section-outer-container').find('.av-active-tab-title');
    		activeElement.next().length ? activeElement.next().trigger('click') : activeElement.siblings(":first").trigger('click');
    	});
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_tab_section_arrows');
    #1295859

    Hi,


    @Guenni007

    Thank you for sharing this. Very nice solution.

    I added this to our dev repo. Thinking to extend this.

    Best regards,
    Günter

    #1295868

    Gerne !

    #1413173

    Thanks for this brilliant solution @Guenni007 !
    I’ve been looking for a way to do this for ages! I think that partly makes up for a missing element in Enfold which is a “section slider” :)
    The only problem I’m having is that actually if I try to put 2 or more tab sections on the same page, when I click on the arrow, it slides every tab of every tab section on the same page!
    Would you have an idea on how to overcome that problem ?
    Thanks a lot in advance for your help!

    #1413201

    Hi @maxgorelkine,

    Just to make sure: There is an option in the tab section that displays the arrows out of the box:

    Tab Section -> Layout Tab -> General Toggle -> Tab Buttons Out Of Screen Behaviour

    But you are right – bug is when there are multiple tab sections on a page.
    Thank you for reporting this.

    I will add a fix for next release 5.6.4.
    If you need it earlier let us know.

    Best regards,
    Günter

    #1413209

    Hello Gunter,

    Well for me, this option displays arrows only next to the tabs and only on small screens.

    What I need is what @Guenni007 proposed, which are arrows on each side of the tab section content allowing to switch from tab to tab, as a slider. I even hid the tabs header .av-tab-section-tab-title-container since I don’t need tabs to be displayed. But unfortunately there isn’t a “Slider Section” that would allow to do that… maybe an idea for a future release ? :))
    New Slider Section proposal

    But yes, It would be amazing to have a fix for this bug earlier if possible.
    Thanks a lot in advance!

    • This reply was modified 1 year, 5 months ago by maxgorelkine.
    #1413229

    Hi @maxgorelkine,

    Thanks for your feedback.

    this option displays arrows only next to the tabs and only on small screens.

    The arrows only show up when tabs exceed viewport width to draw attention that there are more tabs. Add 10 or more tabs and you will also see them on larger screens.

    We have already in beta a slideshow section:

    https://github.com/KriesiMedia/enfold-library/tree/master/temp_fixes/shortcodes%20in%20beta/slideshow_section

    Copy these two files in your child theme folder /shortcodes/slideshow_section.

    Do not forget to remove it in case this element gets into core.

    BTW: It is important that the tabtitles are unique, otherwise clicking on a non unique one will also select all others as active.

    Best regards,
    Günter

    #1413238

    Well that’s just perfect! Exactly what I needed!
    Thank you soooo much!

    #1413239

    Hi,

    Glad it helps you.

    If you find any problems please let us know so we can fix it – open a new thread for that please.

    Best regards,
    Günter

Viewing 23 posts - 1 through 23 (of 23 total)
  • You must be logged in to reply to this topic.