-
AuthorPosts
-
April 11, 2021 at 7:03 pm #1293792
Hi,
I have a Question, if is possible to put two functional arrows in the Tab Section ?Thanks!
- This topic was modified 3 years, 8 months ago by reinkieker.
April 12, 2021 at 6:01 pm #1293980Any suggestions?
Thanks!
April 12, 2021 at 8:27 pm #1293995I 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’);April 15, 2021 at 7:45 am #1294505Hi,
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,
IsmaelApril 15, 2021 at 11:25 am #1294549Hi,
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!April 18, 2021 at 7:40 am #1294967Hi,
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,
RikardApril 18, 2021 at 1:37 pm #1294988Hi,
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.
April 18, 2021 at 5:41 pm #1295004And that function does not include the case if there are more than one tab-section on that page!
April 19, 2021 at 6:30 am #1295116Hi,
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,
IsmaelApril 19, 2021 at 3:04 pm #1295297i did it this way – an for simplicity reasons i only take html entities to form the arrows:
this to child-theme functions.phpfunction 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'>⟨</div><div class='av-tabsection-navs av-tabsection-nav-next'>⟩</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.
April 19, 2021 at 4:08 pm #1295305Hello,
finally works perfect!
Thanks so much !April 19, 2021 at 10:04 pm #1295357One 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.
Sorryf.e.:
.avia_mobile .av-tabsection-navs { opacity: 1; }
April 21, 2021 at 7:07 am #1295694April 21, 2021 at 8:19 am #1295715by 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'>⟨</div><div class='av-tabsection-navs av-tabsection-nav-next'>⟩</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');
April 21, 2021 at 9:07 am #1295725or 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'>⟨</div><div class='av-tabsection-navs av-tabsection-nav-next'>⟩</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');
April 21, 2021 at 5:41 pm #1295859Hi,
Thank you for sharing this. Very nice solution.
I added this to our dev repo. Thinking to extend this.
Best regards,
GünterApril 21, 2021 at 6:43 pm #1295868Gerne !
July 13, 2023 at 1:00 am #1413173Thanks 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!July 13, 2023 at 9:21 am #1413201Hi @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ünterJuly 13, 2023 at 9:56 am #1413209Hello 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 ? :))
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.
July 13, 2023 at 1:24 pm #1413229Hi @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:
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ünterJuly 13, 2023 at 4:41 pm #1413238Well that’s just perfect! Exactly what I needed!
Thank you soooo much!July 13, 2023 at 4:53 pm #1413239 -
AuthorPosts
- You must be logged in to reply to this topic.