846
| <![CDATA[<script type="text/javascript">
function validaBusca(){
if(!$("#ipt-pesquisa").val()){
alertify.alert('<img style="margin:0 auto; max-height:60px" src="https://www.marialva.pr.gov.br//images/brasao_topo.png" class="img-responsive"/>','O campo pesquisa está vazio');
return false;
}
}
function exibirFormulario(param){
if(param == true) {
$('#conteudo-pesquisa').show();
$('#busca').hide();
$('#btn-hidden-pesquisa').hide();
} else {
$('#conteudo-pesquisa').hide();
$('#busca').show();
$('#btn-hidden-pesquisa').show();
}
}
$('iframe').iframeTracker({
blurCallback: function(){
$('#carousel-tv').carousel('pause');
}
});
$(window).scroll(function (event) {
if ($(window).width() > "992") {
event.stopPropagation();
if ($(window).scrollTop() > '10' && $(window).scrollTop() <= '1910') {
$('#menu-lateral').show('fade');
} else {
$('#menu-lateral').hide('fade');
}
}
});
function iniciar(id){
var total = 0;
$('#carousel-tv').carousel('cycle');
for (var i = total; i > 0 ; i--) {
var posicao = i - 1;
$('#video'+posicao )[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
}
}
$(document).ready(function(){
// console.log('teste');
dimensionar();
// alert("teste");
$(".owl-carousel").owlCarousel({
navigation: true,
nav: true,
navText: ["<i class='fa fa-chevron-left' aria-hidden='true'></i>", "<i class='fa fa-chevron-right' aria-hidden='true'></i>"],
autoplay:true,
autoWidth: false,
slideBy: 1,
dots:false,
margin: 0,
loop: false,
responsive: {
0: {
items: 1
},
700: {
items: 2
},
993: {
items: 3
}
}
});
$('#popup-modal_1').modal('show');
$('#popup-modal_2').modal('show');
$('#carousel-tv').on('slide.bs.carousel', function (e) {
var slide = $(e.relatedTarget).index();
if(slide > 0){
var pos = $('#div-scroll-videos').scrollTop();
$("#div-scroll-videos").animate({
scrollTop: pos + 100
}, 800);
} else {
$("#div-scroll-videos").animate({
scrollTop: 0
}, 800);
}
});
window.onresize = function(event){
dimensionar();
}
});
function dimensionar(){
var col = document.getElementById("col-ultima-noticia");
var div = col.getElementsByTagName("div");
var width, height, imagem, img_width, img_height;
for(i = 0; i < div.length; i++){
width = div[i].offsetWidth;
height = div[i].offsetHeight;
imagem = div[i].children;
for(j = 0; j < imagem.length; j++){
img_width = imagem[j].naturalWidth;
img_height = imagem[j].naturalHeight;
if((img_width / img_height) < (width / height)){
imagem[j].classList.add("img-retrato");
imagem[j].classList.remove("img-paisagem");
}
else{
imagem[j].classList.add("img-paisagem");
imagem[j].classList.remove("img-retrato");
}
}
}
}
</script>]]>
|