577
| <![CDATA[<script type="text/javascript">
var IE = navigator.appVersion.indexOf("MSIE") != -1;
$(function () {
var imagem = new Image();
var widthImg, heightImg;
$(".imagensGalerias a").click(function () {
imagem.src = $(this).find("img").attr("src").split("-thumb").join("");
if (imagem.complete) {
fazFuncao();
}
else {
imagem.onload = function () {
fazFuncao();
}
}
});
function fazFuncao() {
widthImg = (-1 * parseInt((imagem.width / 2)));
heightImg = (-1 * parseInt((imagem.height / 2)));
$("#imgAmpliada").html("<img src='" + imagem.src + "' alt='' />");
$("#imgAmpliada").css({ display: "block", marginLeft: widthImg + "px", marginTop: heightImg + "px" });
$("#fundo").css("display", "block");
$("#fechar").css({ display: "block", marginLeft: ((-1 * widthImg) - 45) + "px", marginTop: (heightImg - 20) + "px" });
}
$("#fechar, #imgAmpliada, #fundo").click(function () {
fecharAmpliada();
});
$(document).keydown(function (event) {
if (event.keyCode == 27) {
fecharAmpliada();
}
});
//-- Video
var videoSrc;
var widthVid, heightVid;
var posicaoH, posicaoV;
$(".assisteVideo a").click(
function () {
widthVid = $(this).attr("tamanhoVideoLargura");
heightVid = $(this).attr("tamanhoVideoAltura");
heightFlash = (30 + parseInt(heightVid));
videoSrc = $(this).find("img").attr("srcVideo");
youtubeSrc = $(this).find("img").attr("youtube");
fazFuncaoVideo();
}
);
function fazFuncaoVideo() {
posicaoH = (-1 * parseInt((widthVid / 2)));
posicaoV = (-1 * parseInt((heightVid / 2)));
/*$("#videoAmpliado").html("<iframe width='" + widthVid + "' height='" + heightVid + "' src='" + videoSrc + "' frameborder='0' allowfullscreen>" +
"</iframe>");*/
if (youtubeSrc == "true") {
$("#videoAmpliado").html("<iframe width='" + widthVid + "' height='" + heightVid + "' src='" + videoSrc + "' frameborder='0' allowfullscreen>" +
"</iframe>");
}
else if (youtubeSrc == "false") {
if (!IE) {
$("#videoAmpliado").html("<video class='videoMovie' controls preload='metadata' height='" + heightVid + "px' width='" + widthVid + "px'>" +
"<source src='" + videoSrc + ".webm' />" +
"<source src='" + videoSrc + ".mp4' />" +
"<object class='movieFlash' height='" + heightFlash + "' width='" + widthVid + "' type='application/x-shockwave-flash' data='" + videoSrc + ".swf'>" +
"<param name='movie' value='" + videoSrc + ".swf' />" +
"<param name='play' value='false'/>" +
"</object>" +
"</video>");
}
else if (IE) {
$("#videoAmpliado").html("<object class='movieFlash' height='" + heightFlash + "' width='" + widthVid + "' type='application/x-shockwave-flash' data='" + videoSrc + ".swf'>" +
"<param name='movie' value='" + videoSrc + ".swf' />" +
"<param name='play' value='false'/>" +
"</object>");
}
}
var alturaFundo = $(document).height()
$("#videoAmpliado").css({ display: "block", marginLeft: posicaoH + "px", marginTop: posicaoV + "px" });
$("#fundoVideo").css({ display: "block", height: alturaFundo + "px" });
$("#fecharVideo").css({ display: "block", marginLeft: ((-1 * posicaoH) - 50) + "px", marginTop: (posicaoV - 20) + "px" });
}
$("#fecharVideo, #fundoVideo").click(
function () {
fecharAmpliada();
}
);
function fecharAmpliada() {
$("#videoAmpliado").html('');
$("#videoAmpliado, #fecharVideo, #fundoVideo").css("display", "none");
$("#imgAmpliada").css("display", "none");
$("#fechar").css("display", "none");
$("#fundo").css("display", "none");
}
});
</script>]]>
|