Skip to content

Instantly share code, notes, and snippets.

var timerShowMenu = null ;
var $megaMenu = $('.nav_leftcol')
, $menuItems = $megaMenu.find('.sub_nav')
, changeSpeed = 50
, that = this
, isMenuOpen = false;
var hideDelay = 500;
;$megaMenu.on('mouseenter', '.primary_nav > ul > li', function(evt) {
if (!isMenuOpen) {
timerShowMenu = setTimeout(function() {
var agent = navigator.userAgent.toLowerCase(), appCheck = navigator.appVersion.match(/android|chrome|mobile/gi),
appInfo = {
platform: navigator.platform,
vendor: (/webkit/i).test(navigator.appVersion) ? 'webkit' : (/firefox/i).test(navigator.userAgent) ? 'Moz' : 'opera' in window ? 'O' : (window.ActiveXObject || "ActiveXObject" in window) ? 'ms' : '',
has3d: 'WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix(),
hasTouch: !!(("ontouchstart" in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
hasTransform: this.vendor + 'Transform' in document.documentElement.style,
isIE10: (navigator.appVersion.indexOf("MSIE 10") != -1),
// We need to eliminate Symbian, Series 60, Windows Mobile and Blackberry
disableScrolling: function() {
var that= this;
var body = $('body');
var oWidth = body.outerWidth(true);
body.addClass('themodal-lock');
var sbWidth = body.outerWidth(true) - oWidth;
if (that.isIE()) {
that.ieBodyTopMargin = body.css('margin-top');
body.css('margin-top', 0);
}
entry: {
vendor: ["jquery", "lazyloadxt", "utils"],
critical: "./assets/js/critical.js",
home: "./assets/js/home.js",
search: "./assets/js/search.js",
product: "./assets/js/product.js",
cart: "./assets/js/cart.js",
account: "./assets/js/account.js",
checkout: "./assets/js/checkout.js,
},
@tarunranka
tarunranka / cart.js
Last active September 29, 2017 17:53
import "../sass/cart.scss";
export default class Cart {
static bindCartqty(){
/*code for binding the qty increcment/decrement*/
}
}
jQuery(document).ready(function() {
Cart.bindCartqty()
}
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module: {
rules: [{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: ["css-loader", "sass-loader"]
})
}]
}
function child_theme_dequeue_style()
{
wp_dequeue_style('wpsisac_slick_style');
wp_dequeue_style('wpos-slick-style');
wp_dequeue_style('menu-icons-extra');
wp_dequeue_style('woocommerce_frontend_styles');
wp_dequeue_style('woocommerce-general');
wp_dequeue_style('woocommerce-layout');
wp_dequeue_style('woocommerce-smallscreen');
wp_dequeue_style('woocommerce_fancybox_styles');
var AssetsPlugin = require("assets-webpack-plugin");
new AssetsPlugin({
fullPath: false,
prettyPrint: true,
}),
function load_style()
{
$cssJSON = wp_remote_get(get_stylesheet_directory_uri().'/webpack-assets.json');
$css_data = json_decode($cssJSON['body']);
foreach ($css_data as $key => $cssjson) {
if ($cssjson && isset($cssjson->css)) {
$css_url = get_stylesheet_directory_uri().'/dist/'.$cssjson->css;
if (is_front_page() && $key == "home") {
echo "<link href='$css_url' rel='stylesheet'/>";
/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/.test(a)