(function(jQuery) {
'use strict';
jQuery(document).ready(function($) {
/* ============== masonry Grid ============= */
if( $(".masonry_grid").length){
$('.masonry_grid').masonry({
// set itemSelector so .grid-sizer is not used in layout
itemSelector: '.grid-item',
// use element for option
columnWidth: '.grid-sizer',
percentPosition: true
});
}
if( $("#popup-search").length){
$('#popup-search').on('click', function(e) {
e.preventDefault();
$('.popup-search').fadeIn();
});
}
if( $(".close-popup").length){
$('.close-popup').on('click', function(e) {
e.preventDefault();
$('.popup-search').hide();
});
}
if( $("#nav-expander").length){
$('#nav-expander').on('click', function(e) {
e.preventDefault();
$('body').toggleClass('nav-expanded');
});
}
if( $("#nav-close").length){
$('#nav-close').on('click', function(e) {
e.preventDefault();
$('body').removeClass('nav-expanded');
});
}
if( $('.newsbd24_news_ticker_js_action').length ){
$('.newsbd24_news_ticker_js_action').newsTicker({
row_height: 30,
max_rows: 1,
speed: 600,
direction: 'up',
duration: 4000,
autostart: 1,
pauseOnHover: 1
});
}
if( $('.postGallery').length ){
$('.postGallery').owlCarousel({
loop:true,
margin:0,
nav:true,
dots:false,
navText: [ '', '' ],
responsive:{
0:{
items:1
},
600:{
items:1
},
1000:{
items:1
}
}
});
}
if( $('.image-popup').length ){
$('.image-popup').magnificPopup({
closeBtnInside : true,
type : 'image',
mainClass : 'mfp-with-zoom'
});
}
if( $('#back-to-top').length ){
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
// scroll body to 0px on click
$('#back-to-top').click(function () {
$('#back-to-top').tooltip('hide');
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
}
if( $('#back-to-top').length ){
$("#sticker").sticky({topSpacing:0});
}
$(function() {
$('[data-toggle="tooltip"]').tooltip()
})
});
})(jQuery);
function FindLeftWindowBoundry()
{
// In Internet Explorer window.screenLeft is the window's left boundry
if (window.screenLeft)
{
return window.screenLeft;
}
// In Firefox window.screenX is the window's left boundry
if (window.screenX)
return window.screenX;
return 0;
}
// Find Left Boundry of current Window
function FindTopWindowBoundry()
{
// In Internet Explorer window.screenLeft is the window's left boundry
if (window.screenTop)
{
return window.screenTop;
}
// In Firefox window.screenY is the window's left boundry
if (window.screenY)
return window.screenY;
return 0;
}
function goclicky(meh)
{
console.log(FindLeftWindowBoundry(), FindTopWindowBoundry());
var x = screen.width/2 - 700/2 + FindLeftWindowBoundry();
var y = screen.height/2 - 450/2 + FindTopWindowBoundry();
window.open(meh.href, 'sharegplus','height=485,width=700,left='+x+',top='+y);
}