Answer the question
In order to leave comments, you need to log in
Articles for every tab, what's the problem?
Hello!
I make changes on the site, on the page univerokrug.hse.perm.ru/announces
window.events_page = 1;
function show_else_ann(page) {
var tabidd = jQuery('[data-tabs="ANNOUNCE"] .current').data('tab');
if ( jQuery('[data-tabs="ANNOUNCE"] #tabid' +tabidd+ '.current').data('tab') ) {
page = window.events_page + 1;
window.events_page = page;
console.log(window.events_page = page);
}
$('.tabs_panel>A').click(function(){
window.events_page = 1;
});
window.events_page = page;
jQuery.ajax({
url: '<?= SITE_TEMPLATE_PATH; ?>/ajax/announces.php',
data: {
page: page,
code: '<?= $IBLOCK_CODE; ?>',
tab: jQuery('[data-tabs="ANNOUNCE"] .current').data('tab'),
per: <?= $PER; ?>,
date: 2,
<?php
if (isset($QUESTION) and $QUESTION) { ?>
question: 1,
<?php } ?>
href: '/announces/' <?= (isset($_REQUEST['ID']) ? ', id: ' . (int)$_REQUEST['ID'] : ''); ?>},
method: 'POST',
dataType: 'JSON',
success: function(data) {
if (data.items) {
var i = 0;
for (i in data.items) {
var tabidfix = jQuery('[data-tabs="ANNOUNCE"] .current').data('tab');
jQuery('#cann' +tabidfix+ ' .event_container_a').append(data.items[i]);
}
if (data.items.length != <?= $PER; ?>) {
jQuery('.show_else_a').hide();
}
}
if (data.items.length == 0) {
jQuery('.show_else_a').hide();
}
}
});
}
$('.tabs_panel>A').click(function(){
window.events_page = 1;
});
jQuery('.tabs_panel>A').click(function(){
jQuery('.show_else_a').show();
});
Answer the question
In order to leave comments, you need to log in
The Show more button is only in the content of the active tab. How will she appear in another tab if she is not there? Each tab must have its own, otherwise everything will be shown, even where it is already hidden.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question