$(document).ready(function() { obtenerFotosFlickr(12, "gallery-flickr"); obtenerTweetsTurismo("gallery-twitter"); $('#media').carousel({ pause: true, interval: false, }); /*$('.modal').modal() ; $('.modal').on('show.bs.modal', prepareModal); $(window).on("resize", function () { $('.modal:visible').each(prepareModal); });*/ /* $('[data-toggle="modal"]').on("click", function(e){ e.stopPropagation(); contenido = $(this).attr("data-contenido-dato"); console.log(contenido); if($(this).attr("data-contenido-tipo")=="IMG"){ $('.modal').find('.modal-body img').attr('src',contenido); $('.modal').find('.modal-body div').hide(); $('.modal').find('.modal-body img').show(); }else{ $('.modal').find('.modal-body div source').attr('src',contenido); $('.modal').find('.modal-body img').hide(); $('.modal').find('.modal-body div').show(); $('.modal-body div video')[0].load(); } prepareModal($('.modal')); $('.modal').modal() ; } ); */ $('body').on('hidden.bs.modal', '.modal', function () { console.log("close"); $('.modal-body div video').trigger("pause"); }); }); ;(function($){ /** * jQuery function to prevent default anchor event and take the href * and the title to make a share popup * * @param {[object]} e [Mouse event] * @param {[integer]} intWidth [Popup width defalut 500] * @param {[integer]} intHeight [Popup height defalut 400] * @param {[boolean]} blnResize [Is popup resizeabel default true] */ $.fn.customerPopup = function (e, intWidth, intHeight, blnResize) { // Prevent default anchor event e.preventDefault(); // Set values for window intWidth = intWidth || '500'; intHeight = intHeight || '400'; strResize = (blnResize ? 'yes' : 'no'); // Set title and open popup with focus on it var strTitle = ((typeof this.attr('title') !== 'undefined') ? this.attr('title') : 'Social Share'), strParam = 'width=' + intWidth + ',height=' + intHeight + ',resizable=' + strResize, objWindow = window.open(this.attr('href'), strTitle, strParam).focus(); } /* ================================================== */ $(document).ready(function ($) { $('.customer.share').on("click", function(e) { $(this).customerPopup(e); }); }); }(jQuery)); function prepareModal(modal) { modal.css('display', 'block'); var $dialog = modal.find(".modal-dialog"); var offset = ($(window).height() - $dialog.height()) / 2; // Center modal vertically in window $dialog.css("margin-top", offset); }