Avenger1

Рейтинг
0
Регистрация
05.11.2015
Gerga:
Avenger1, что-то типа этого:

if ( $('.tabs1 > li').length > $('.tabs1_content > div').length ) {
var i = 0;
$('.tabs1 > li').each(function() {
i++;
if ( $('.tabs1_content > div:nth-child('+i+')').length == 0 ) {
$(this).addClass('tab-empty')
// если хотите удалить пустые, то addClass('tab-empty')
// меняете на remove().
// вот так: $(this).remove()
}

})
}

https://jsfiddle.net/webxz/4d0r6ync/
Пустым присвоим класс tab-empty, чтобы удалить пустые, можете addClass('tab-empty') сменить на remove()

PS: У вас не очень приятная реализация табов

Это конешно не вежливо спрашивать. НО!

Как я понял мне этот год вставлять в JS?

А вывод из JS мне нужно вставлять в fullstory?

[xfgiven_producer_url][xfvalue_producer_url][/xfgiven_producer_url] <br>
<br> перенесите везде внутрь условия
Цитата:
[xfgiven_producer_url][xfvalue_producer_url]<br>[/xfgiven_producer_url]

Спасибо. Исправил.

JS Код

// jTabs Plugin for jQuery - Version 0.3

// by Angel Grablev for Enavu Web Development network (enavu.com)

// Dual license under MIT and GPL :) enjoy

/*

To use simply call .jTabs() on the element that holds your tabs and pass in content for the element that holds your tabs content:

$("ul.tabs").jTabs({content: "content_class"});

you can specify the following options:

content = the element that will hold the divs with the content of each tab

equal_height = true/false to enable the columns to find the highest tab and set the height across all tabs

cookies = true/false will use browser cookies to store which tab the user is on

animate = true/false if you would like to use an animation effect when you switch tabs

effect = which animation effect would you like to use (default is fade) other option includes slide

speed = if you have animation to true you can choose how long to take the effect to take place

*/

(function($){

$.fn.jTabs = function(options) {

var defaults = {

content: "div.content",

equal_height: false,

cookies: false,

animate: false,

effect: "fade",

speed: 400

};

var options = $.extend(defaults, options);

return this.each(function() {

// object is the selected pagination element list

obj = $(this);

var objTabs = $(options.content);

var number_of_items = obj.children("li").size();

var tabIndex = [];

var tabs = [];

// create array of tab index items

for (i=1;i<=number_of_items;i++) { tabIndex = obj.find("li:nth-child("+i+")"); tabIndex.attr("title", i); }

// create array tabs
for (i=1;i<=number_of_items;i++) { tabs = $(options.content + "> div:nth-child("+i+")"); }

// if equal height on
if(options.equal_height) {
var maxHeight = 0;
$(options.content).children("div").each(function(){
if ($(this).outerHeight() > maxHeight) { maxHeight = $(this).outerHeight(); }
});
$(options.content).height(maxHeight);
}

// initiate the current tab
if (options.cookies) {
if (getCookie("page")) { showTab(getCookie("page")); }
else { setCookie("page",1,999); showTab(1); }
} else {
showTab(1);
}

function showTab(num) {
tabIndex[num].addClass("active").siblings().removeClass("active");
if(!options.animate) { tabs[num].show().siblings().hide(); }
else {

switch (options.effect) {
case "fade":
tabs[num].fadeIn(options.speed).siblings().hide();
break;
case "slide":
tabs[num].slideDown(options.speed).siblings().hide();
break;
}

}
}


obj.find("li").live("click", function(e){
e.preventDefault();
var tab_num = $(this).attr("title");
showTab(tab_num);
if (options.cookies) setCookie("page",tab_num,999);
});


/* code to handle cookies */
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+
((expiredays==null)?"":";expires="+exdate.toUTCString());
}
function getCookie(c_name)
{
if(document.cookie.length>0)
{c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";
}
});


};
})(jQuery);

CSS

@font-face {
font-family: 'socialnetworks';
src: url('../fonts/socialnetworks.eot');
src: url('../fonts/socialnetworks.eot') format('embedded-opentype'),
url('../fonts/socialnetworks.woff2') format('woff2'),
url('../fonts/socialnetworks.woff') format('woff'),
url('../fonts/socialnetworks.ttf') format('truetype'),
url('../fonts/socialnetworks.svg#socialnetworks') format('svg');
}

ul.tabs1 {list-style:none;
background: transparent;
position: relative;
margin: 0 auto;
width:100%;
background: transparent;
}
ul.tabs1 li {
float: left;
margin: 0;
padding: 0;
border-left: none;
overflow: hidden;
position: relative;
background: transparent;
}
ul.tabs1 li.active {
border-bottom:1px solid #fff;
background: transparent;
margin-bottom:-1px;
}
ul.tabs1 li a {display:block;
padding:3px 20px;
color:#333;
letter-spacing:-1px;
outline:none;
text-decoration:none;
font-weight:600;
font-family: url(../fonts/socialnetworks.ttf) ;
font-size:15px;
}
ul.tabs1 li.active a {
font-weight:600;
font-family: url(../fonts/socialnetworks.ttf) ;
font-size:15px;
color:#000;
border-bottom: 3px solid #30c2f2;
}

div.tabs1_content {width:100%;}
div.tabs1_content > div {padding-top:20px; display:none;

}

Шаблон (Fullstory)

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="{THEME}/js/jTabs.js"></script>
<script>
$(document).ready(function(){
$("ul.tabs1").jTabs({content: ".tabs1_content", animate: true, cookies:false});
});
</script>
<div id="bgfilms">
<center>
<div id="player" width="790" height="450" src="{title}" frameborder="0" allowfullscreen>

[hdlight-player]
<center>
{hdlight-player}
</center>
[/hdlight-player]
</div>
<!-- Сюда будет выведен плеер !-->
<button class="btn light" onclick="UppodCurtain('player')">Выключить свет </button></center>
<br>
</div>
<div id='dle-content'>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<span style=" margin-left:8px; margin-bottom:10px" class="btn btn-warning full-width" rel="tooltip" onclick="$('#bgfilms').slideToggle();return false;"></i> <b>Нажми для просмотра <br>{title limit="25"}</b></span>
<div class="head-movie">
<img class="click-img" src="{image-1}" height="276" width="389" />
[rating]
[rating-type-1]<div style="margin-left:47px; margin-bottom:10px" ><div class="rate">{rating}</div></div>[/rating-type-1]
[rating-type-2]<div style="margin-left:47px; margin-bottom:10px">
<ul style="margin-left:50px; margin-bottom:10px" class="reset">
<li>[rating-plus]<img src="{THEME}/images/like.png" title="Нравится" alt="Нравится" style="width:14px;" />[/rating-plus]</li>
<li>{rating}</li>
</ul></div>[/rating-type-2]
[rating-type-3]<div style="margin-left:47px; margin-bottom:10px">
<ul style="margin-left:47px; margin-bottom:10px" class="reset">
<li>[rating-minus]<img src="{THEME}/images/ratingminus.png" title="Не нравится" alt="Не нравится" style="width:14px;" />[/rating-minus]</li>
<li>{rating}</li>
<li>[rating-plus]<img src="{THEME}/images/ratingplus.png" title="Нравится" alt="Нравится" style="width:14px;" />[/rating-plus]</li>
</ul>
</div>[/rating-type-3]
[/rating]
<p>Рейтинг: [xfgiven_rating][xfvalue_rating][/xfgiven_rating]&nbsp;&nbsp;
[xfgiven_imdb][xfvalue_imdb][/xfgiven_imdb]</p>
[xfgiven_age]<p class="feature1">[xfvalue_age] </p>[/xfgiven_age]
<br>
[xfgiven_year_url][xfvalue_year_url][/xfgiven_year_url]<br>
[xfgiven_country_url][xfvalue_country_url][/xfgiven_country_url]<br>
[xfgiven_genre_url][xfvalue_genre_url][/xfgiven_genre_url]<br>
[xfgiven_actors_url][xfvalue_actors_url][/xfgiven_actors_url]<br>
[xfgiven_time]<p class="maininblock1">[xfvalue_time][/xfgiven_time]</p>
</div>
<div class="head-movie">
<div class="full-kino-info">[xfgiven_budget]<span>[xfvalue_budget]</span>[/xfgiven_budget]
<p><b>Сборы в:</b> </p>
[xfgiven_charges_world]<span>[xfvalue_charges_world]</span>[/xfgiven_charges_world]<br>
[xfgiven_charges_usa][xfvalue_charges_usa][/xfgiven_charges_usa]<br>
[xfgiven_charges_rus][xfvalue_charges_rus][/xfgiven_charges_rus]<br>
<br>[xfgiven_studio][xfvalue_studio][/xfgiven_studio]</div>
</div>
<div class="head-movie">
<div class="divider"> </div>
[xfgiven_torrent] <p class="btn btn-success full-width" rel="tooltip" id="a_download" data-original-title="{title}">[xfvalue_torrent]</p>[/xfgiven_torrent]

<div class="divider"></div>
<span class="btn btn-info full-width" rel="tooltip" onclick="$('#social').slideToggle();return false;" data-original-title="Поделиться с друзьями">Поделиться</span>
<div id="social">
<div class="alert alert-info"><center><script type="text/javascript">(function() {
if (window.pluso)if (typeof window.pluso.start == "function") return;
if (window.ifpluso==undefined) { window.ifpluso = 1;
var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
s.src = ('https:' == window.location.protocol ? 'https' : 'http') + '://share.pluso.ru/pluso-like.js';
var h=d[g]('body')[0];
h.appendChild(s);
}})();</script>
<div class="pluso" data-background="transparent" data-options="big,square,multiline,horizontal,nocounter,theme=08" data-services="vkontakte,odnoklassniki,facebook,twitter,google,yazakladki,email" data-background="#ebebeb">
</div></center></div>
</div>
</div>
[banner_left]
{banner_left}
[/banner_left]
</div>

<div class="span8">
<div class="head-movie">
<h3>{favorites} {title}</h3>
[xfgiven_name_foreign] [xfvalue_name_foreign][/xfgiven_name_foreign]
[banner_header]
{banner_header}
[/banner_header]
[not-group=5]<small>{views}</small>[/not-group]
<div class="divider"></div>
[not-group=5]<span class="argedit">[edit]<i>Редактировать</i>[/edit]</span>[/not-group]

<dt></dt>
<!-- tabs content -->
<ul class="tabs1">
<li class="active"><a href="#" title="Описание" >Описание</a></li>
<li><a href="#" title="Съемочная группа">Съемочная группа</a></li>
<li><a href="#" title="Кадры">Трейлер и Кадры</a></li>
<li><a href="#" title="Рецензии">Рецензии</a></li>
</ul>
<div style="clear:both"></div>
<div class="tabs1_content">
<div> <p>{full-story}</p></div>
<div>
[xfgiven_director_url][xfvalue_director_url][/xfgiven_director_url]<br>
[xfgiven_scenario_url][xfvalue_scenario_url][/xfgiven_scenario_url]<br>
[xfgiven_producer_url][xfvalue_producer_url][/xfgiven_producer_url] <br>
[xfgiven_operator_url][xfvalue_operator_url][/xfgiven_operator_url]<br>
[xfgiven_composer_url][xfvalue_composer_url][/xfgiven_composer_url]<br>
[xfgiven_artist_url][xfvalue_artist_url][/xfgiven_artist_url]<br>
[xfgiven_installation_url][xfvalue_installation_url][/xfgiven_installation_url]</div>
<div><p>[xfgiven_trailer][xfvalue_trailer][/xfgiven_trailer]</p><br>
<h3>Кадры</h3><br>[xfgiven_stills][xfvalue_stills][/xfgiven_stills]</div>
<div>[xfgiven_review][xfvalue_review][/xfgiven_review]</div>
</div>
<!-- tabs content -->

</div>
</div>
</div>
<br>
[banner_topup]
{banner_topup}
[/banner_topup]
[related-news]
<div class="related">
<div class="dtop"><span><b>А также:</b></span></div>
<ul class="reset">
{related-news}
</ul>
</div>
[/related-news]
</div><br>
<center><span class="btn btn-danger" onclick="$('#ssc2').slideToggle();return false;"><i class="icon-pencil" data-original-title="{title}"></i> Оставь свой отзыв </span></center>
{addcomments}
<div class="divider"></div>
{comments}
дани мапов:
По второму вопросу - используйте xfgiven

Да.

Забыл сказать что движок DLE 10.5