20 сентября 2019
Нет комментариев
n=parseFloat(n.toFixed(1));
n=parseFloat(n.toFixed(1));
var owl=$('#owl'); owl.owlCarousel({ loop:true, margin:0, items:1, dots:true, nav:true, navText:['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'], }); owl.on('changed.owl.carousel',function(e){ $('.counter span').text(e.page.index+1); });
<div class="owl-carousel owl-theme" id="owl"> <?php foreach($items as $item){?> <div class="item"></div> <?}?> </div> <div class="counter"><span>1</span> | <?=count($items)?></div>
Использовать javascript: window.top.location.href
Например вместо:
header("Location: ".$result_data->response->body->url_login);
указать:
header("Location: /?goto=".$result_data->response->body->url_login);
и на самой странице:
<?php if(isset($_GET['goto'])){?> <script> window.top.location.href="<?=$_GET['goto']?>"; window.location.href="<?=$_GET['goto']?>"; </script> <?}?>
$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif']").fancybox({ helpers:{title:{type:'over'}}, padding:'0', afterShow:function(){ $('.fancybox-wrap').touchwipe({ wipeLeft:function(){$.fancybox.next();}, wipeRight:function(){$.fancybox.prev();}, preventDefaultEvents:false, }); } });
https://www.netcu.de/jquery-touchwipe-iphone-ipad-library
$('.block').each(function(){ if($(this).find('.content').html()==''){ $(this).hide(); } });
Применить стили к :before
(1200 — ширина рабочей области)
$(window).load(function(){ var half=(parseInt($(window).width())-1200)/2; $('head').append('<style>.title:before{width:'+(half-15)+'px;left:-'+half+'px;}</style>'); });
Javascript:
$('#owl_1').owlCarousel({ loop:true, margin:0, items:1, nav:false, dots:false, autoplay:true, autoplayTimeout:500, animateOut:'fadeOut', animateIn:'fadeIn', });
Less:
#owl_1{ .animated{ -webkit-animation-duration:0ms; animation-duration:0ms; -webkit-animation-fill-mode:both; animation-fill-mode:both; } .fadeOut{ -webkit-animation-name:fadeOut; animation-name:fadeOut; } @-webkit-keyframes fadeOut{ 0%{ opacity:0; } 100%{ opacity:0; } } @keyframes fadeOut{ 0%{ opacity:0; } 100%{ opacity:0; } } }