i’ve script.js file for html to wordpress conversion. In html it really works, however in wordpress it doesn’t work. This file accommodates slider, menus and so on, I allow to transform html to wordpress with out this file, the file has following contents
operate embrace(scriptUrl) {
doc.write('<script src="' + scriptUrl + '"></script>');
}
operate isIE() {
var myNav = navigator.userAgent.toLowerCase();
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.break up('msie')[1]) : false;
};
/* cookie.JS
========================================================*/
embrace('js/jquery.cookie.js');
/* Easing library
========================================================*/
embrace('js/jquery.easing.1.3.js');
/* Stick up menus
========================================================*/
;
(operate ($) {
var o = $('html');
if (o.hasClass('desktop')) {
embrace('js/tmstickup.js');
$(doc).prepared(operate () {
$('#stuck_container').TMStickUp({})
});
}
})(jQuery);
/* ToTop
========================================================*/
;
(operate ($) {
var o = $('html');
if (o.hasClass('desktop')) {
embrace('js/jquery.ui.totop.js');
$(doc).prepared(operate () {
$().UItoTop({
easingType: 'easeOutQuart',
containerClass: 'toTop fa fa-arrow-up'
});
});
}
})(jQuery);
/* EqualHeights
========================================================*/
;
(operate ($) {
var o = $('[data-equal-group]');
if (o.size > 0) {
embrace('js/jquery.equalheights.js');
}
})(jQuery);
/* SMOOTH SCROLLIG
========================================================*/
;
(operate ($) {
var o = $('html');
if (o.hasClass('desktop')) {
embrace('js/jquery.mousewheel.min.js');
embrace('js/jquery.simplr.smoothscroll.min.js');
$(doc).prepared(operate () {
$.srSmoothscroll({
step: 150,
pace: 800
});
});
}
})(jQuery);
/* Copyright Yr
========================================================*/
;
(operate ($) {
var currentYear = (new Date).getFullYear();
$(doc).prepared(operate () {
$("#copyright-year").textual content((new Date).getFullYear());
});
})(jQuery);
/* Superfish menus
========================================================*/
;
(operate ($) {
embrace('js/superfish.js');
})(jQuery);
/* Navbar
========================================================*/
;
(operate ($) {
embrace('js/jquery.rd-navbar.js');
})(jQuery);
/* Digicam
========================================================*/
;(operate ($) {
var o = $('#digicam');
if (o.size > 0) {
if (!(isIE() && (isIE() > 9))) {
embrace('js/jquery.cellular.custom-made.min.js');
}
embrace('js/digicam.js');
$(doc).prepared(operate () {
o.digicam({
autoAdvance: true,
peak: '25.8536%',
minHeight: '300px',
pagination: true,
thumbnails: false,
playPause: false,
hover: false,
loader: 'none',
navigation: false,
navigationHover: false,
mobileNavHover: false,
fx: 'simpleFade'
})
});
}
})(jQuery);
/* FancyBox
========================================================*/
;(operate ($) {
var o = $('.thumb');
if (o.size > 0) {
embrace('js/jquery.fancybox.js');
embrace('js/jquery.fancybox-media.js');
embrace('js/jquery.fancybox-buttons.js');
$(doc).prepared(operate () {
o.fancybox();
});
}
})(jQuery);
/* Parallax
=============================================*/
;(operate ($) {
embrace('js/jquery.rd-parallax.js');
})(jQuery);
/* Google Map
========================================================*/
;
(operate ($) {
var o = doc.getElementById("google-map");
if (o) {
embrace('//maps.google.com/maps/api/js?sensor=false');
embrace('js/jquery.rd-google-map.js');
$(doc).prepared(operate () {
var o = $('#google-map');
if (o.size > 0) {
var styleArray = [
{
"featureType": "administrative.locality",
"elementType": "all",
"stylers": [
{
"hue": "#2c2e33"
},
{
"saturation": 7
},
{
"lightness": 19
},
{
"visibility": "on"
}
]
},
{
"featureType": "panorama",
"elementType": "all",
"stylers": [
{
"hue": "#ffffff"
},
{
"saturation": -100
},
{
"lightness": 100
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "poi",
"elementType": "all",
"stylers": [
{
"hue": "#ffffff"
},
{
"saturation": -100
},
{
"lightness": 100
},
{
"visibility": "off"
}
]
},
{
"featureType": "highway",
"elementType": "geometry",
"stylers": [
{
"hue": "#bbc0c4"
},
{
"saturation": -93
},
{
"lightness": 31
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "highway",
"elementType": "labels",
"stylers": [
{
"hue": "#bbc0c4"
},
{
"saturation": -93
},
{
"lightness": 31
},
{
"visibility": "on"
}
]
},
{
"featureType": "highway.arterial",
"elementType": "labels",
"stylers": [
{
"hue": "#bbc0c4"
},
{
"saturation": -93
},
{
"lightness": -2
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "highway.native",
"elementType": "geometry",
"stylers": [
{
"hue": "#e9ebed"
},
{
"saturation": -90
},
{
"lightness": -8
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "transit",
"elementType": "all",
"stylers": [
{
"hue": "#e9ebed"
},
{
"saturation": 10
},
{
"lightness": 69
},
{
"visibility": "on"
}
]
},
{
"featureType": "water",
"elementType": "all",
"stylers": [
{
"hue": "#e9ebed"
},
{
"saturation": -78
},
{
"lightness": 67
},
{
"visibility": "simplified"
}
]
}
]
o.googleMap({
kinds: styleArray,
});
}
});
}
})
(jQuery);
(operate ($) {
var o = doc.getElementById("google-map2");
if (o) {
embrace('//maps.google.com/maps/api/js?sensor=false');
embrace('js/jquery.rd-google-map.js');
$(doc).prepared(operate () {
var o = $('#google-map2');
if (o.size > 0) {
var styleArray = [
{
"featureType": "administrative.locality",
"elementType": "all",
"stylers": [
{
"hue": "#2c2e33"
},
{
"saturation": 7
},
{
"lightness": 19
},
{
"visibility": "on"
}
]
},
{
"featureType": "panorama",
"elementType": "all",
"stylers": [
{
"hue": "#ffffff"
},
{
"saturation": -100
},
{
"lightness": 100
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "poi",
"elementType": "all",
"stylers": [
{
"hue": "#ffffff"
},
{
"saturation": -100
},
{
"lightness": 100
},
{
"visibility": "off"
}
]
},
{
"featureType": "highway",
"elementType": "geometry",
"stylers": [
{
"hue": "#bbc0c4"
},
{
"saturation": -93
},
{
"lightness": 31
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "highway",
"elementType": "labels",
"stylers": [
{
"hue": "#bbc0c4"
},
{
"saturation": -93
},
{
"lightness": 31
},
{
"visibility": "on"
}
]
},
{
"featureType": "highway.arterial",
"elementType": "labels",
"stylers": [
{
"hue": "#bbc0c4"
},
{
"saturation": -93
},
{
"lightness": -2
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "highway.native",
"elementType": "geometry",
"stylers": [
{
"hue": "#e9ebed"
},
{
"saturation": -90
},
{
"lightness": -8
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "transit",
"elementType": "all",
"stylers": [
{
"hue": "#e9ebed"
},
{
"saturation": 10
},
{
"lightness": 69
},
{
"visibility": "on"
}
]
},
{
"featureType": "water",
"elementType": "all",
"stylers": [
{
"hue": "#e9ebed"
},
{
"saturation": -78
},
{
"lightness": 67
},
{
"visibility": "simplified"
}
]
}
]
o.googleMap({
kinds: styleArray,
});
}
});
}
})
(jQuery);
/* WOW
========================================================*/
;
(operate ($) {
var o = $('html');
if ((navigator.userAgent.toLowerCase().indexOf('msie') == -1 ) || (isIE() && isIE() > 9)) {
if (o.hasClass('desktop')) {
embrace('js/wow.js');
$(doc).prepared(operate () {
new WOW().init();
});
}
}
})(jQuery);
/* Contact Type
========================================================*/
;
(operate ($) {
var o = $('#contact-form');
if (o.size > 0) {
embrace('js/modal.js');
embrace('js/TMForm.js');
if($('#contact-form .recaptcha').size > 0){
embrace('../www.google.com/recaptcha/api/js/recaptcha_ajax.js');
}
}
})(jQuery);
/* Search.js
========================================================*/
;
(operate ($) {
embrace('js/TMSearch.js');
})(jQuery);
/* Orientation pill repair
========================================================*/
$(operate () {
// IPad/IPhone
var viewportmeta = doc.querySelector && doc.querySelector('meta[name="viewport"]'),
ua = navigator.userAgent,
gestureStart = operate () {
viewportmeta.content material = "width=device-width, minimum-scale=0.25, maximum-scale=1.6, initial-scale=1.0";
},
scaleFix = operate () {
if (viewportmeta && /iPhone|iPad/.take a look at(ua) && !/Opera Mini/.take a look at(ua)) {
viewportmeta.content material = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
doc.addEventListener("gesturestart", gestureStart, false);
}
};
scaleFix();
// Menu Android
if (window.orientation != undefined) {
var regM = /ipod|ipad|iphone/gi,
outcome = ua.match(regM);
if (!outcome) {
$('.sf-menus li').every(operate () {
if ($(">ul", this)[0]) {
$(">a", this).toggle(
operate () {
return false;
},
operate () {
window.location.href = $(this).attr("href");
}
);
}
})
}
}
});
var ua = navigator.userAgent.toLocaleLowerCase(),
regV = /ipod|ipad|iphone/gi,
outcome = ua.match(regV),
userScale = "";
if (!outcome) {
userScale = ",user-scalable=0"
}
doc.write('<meta identify="viewport" content material="width=device-width,initial-scale=1.0' + userScale + '">');
i attempted many strategies. how ought to i embrace this to work in a wordpress in correct manner?