envialia Kargo İstanbul Türkiye telefon. +0538-5922548 – +90212 662 0031 www.rcscargo.net
jQuery(document).ready(function() {
// CUSTOM AJAX CONTENT LOADING FUNCTION
ajaxRevslider = function(obj) {
// obj.type : Post Type
// obj.id : ID of Content to Load
// obj.aspectratio : The Aspect Ratio of the Container / Media
// obj.selector : The Container Selector where the Content of Ajax will be injected. It is done via the Essential Grid on Return of Content
var content = "";
data = {};
data.action = 'revslider_ajax_call_front';
data.client_action = 'get_slider_html';
data.token = '5f5a7a81f7';
data.type = obj.type;
data.id = obj.id;
data.aspectratio = obj.aspectratio;
// SYNC AJAX REQUEST
jQuery.ajax({
type:"post",
url:"http://www.envialia.com/wp-admin/admin-ajax.php",
dataType: 'json',
data:data,
async:false,
success: function(ret, textStatus, XMLHttpRequest) {
if(ret.success == true)
content = ret.data;
},
error: function(e) {
console.log(e);
}
});
// FIRST RETURN THE CONTENT WHEN IT IS LOADED !!
return content;
};
// CUSTOM AJAX FUNCTION TO REMOVE THE SLIDER
var ajaxRemoveRevslider = function(obj) {
return jQuery(obj.selector+" .rev_slider").revkill();
};
// EXTEND THE AJAX CONTENT LOADING TYPES WITH TYPE AND FUNCTION
var extendessential = setInterval(function() {
if (jQuery.fn.tpessential != undefined) {
clearInterval(extendessential);
if(typeof(jQuery.fn.tpessential.defaults) !== 'undefined') {
jQuery.fn.tpessential.defaults.ajaxTypes.push({type:"revslider",func:ajaxRevslider,killfunc:ajaxRemoveRevslider,openAnimationSpeed:0.3});
// type: Name of the Post to load via Ajax into the Essential Grid Ajax Container
// func: the Function Name which is Called once the Item with the Post Type has been clicked
// killfunc: function to kill in case the Ajax Window going to be removed (before Remove function !
// openAnimationSpeed: how quick the Ajax Content window should be animated (default is 0.3)
}
}
},30);
});
gtag('config', 'UA-24785933-10');
";
document.getElementsByTagName("head")[0].appendChild(htmlDiv.childNodes[0]);
}
jQuery(document).ready(function($) {
$.fn.scrollBottom = function() {
return $(document).height() - this.scrollTop() - this.height();
};
var executed = false;
var windowObj = $(window);
var body = $('body');
var bodyOffsetBottom = windowObj.scrollBottom();
var bodyHeightAdjustment = body.height() - bodyOffsetBottom;
var bodyHeightAdjusted = body.height() - bodyHeightAdjustment;
var contentDock = $('.tco-content-dock');
function sizingUpdate() {
var bodyOffsetTop = windowObj.scrollTop();
if ( bodyOffsetTop > ( bodyHeightAdjusted * 0 ) ) {
if ( ! executed ) {
executed = true;
contentDock.toggleClass('tco-content-dock-off').toggleClass('tco-content-dock-on').css('left', '20px');
}
}
$('.tco-close-content-dock').click( function( e ) {
e.preventDefault();
contentDock.toggleClass('tco-content-dock-off').toggleClass('tco-content-dock-on').css('left', '-550px');
});
$('#tco_content_dock_do_not_show').change( function( e ) {
e.preventDefault();
contentDock.toggleClass('tco-content-dock-off').toggleClass('tco-content-dock-on').css('left', '-550px');
var data = {
'action': 'tco_content_dock_do_not_show',
'tco_content_dock_do_not_show': 1
};
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
$.post(
'http://www.envialia.com/wp-admin/admin-ajax.php',
data,
function( response ) {
// done silently
});
});
}
window.setTimeout( function() {
if ( ! executed ) {
executed = true;
contentDock.toggleClass('tco-content-dock-off').toggleClass('tco-content-dock-on').css('left', '20px');
}
}, 2000);
windowObj.bind('scroll', sizingUpdate).resize(sizingUpdate);
sizingUpdate();
});