This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get The Page ID You Need | |
get_option( 'woocommerce_shop_page_id' ); | |
get_option( 'woocommerce_cart_page_id' ); | |
get_option( 'woocommerce_checkout_page_id' ); | |
get_option( 'woocommerce_pay_page_id' ); | |
get_option( 'woocommerce_thanks_page_id' ); | |
get_option( 'woocommerce_myaccount_page_id' ); | |
get_option( 'woocommerce_edit_address_page_id' ); | |
get_option( 'woocommerce_view_order_page_id' ); | |
get_option( 'woocommerce_terms_page_id' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//rotate video 90degrees clockwise | |
ffmpeg -i in.mov -vf "transpose=1" out.mov | |
//0 = 90CounterCLockwise and Vertical Flip (default) | |
//1 = 90Clockwise | |
//2 = 90CounterClockwise | |
//3 = 90Clockwise and Vertical Flip | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hash = { | |
// Получаем данные из адреса | |
get: function() { | |
var vars = {}, hash, splitter, hashes; | |
if (!this.oldbrowser()) { | |
var pos = window.location.href.indexOf('?'); | |
hashes = (pos != -1) ? decodeURIComponent(window.location.href.substr(pos + 1)) : ''; | |
splitter = '&'; | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.elem').on('click', function (e) { | |
var elemW = $('.elem').width(), | |
elemH = $('.elem').height(), | |
xClick = e.pageX - $(this).offset().left, | |
yClick = e.pageY - $(this).offset().top, | |
xClickPercent = (xClick/elemW)*100, | |
yClickPercenr = (yClick/elemH)*100; | |
console.log('x = ' + xClickPercent + '%', 'y = ' + yClickPercenr + '%'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.preloadImages = function() { | |
for (var i = 0; i < arguments.length; i++) { | |
$("<img />").attr("src", arguments[i]); | |
} | |
} | |
$.preloadImages("hoverimage1.jpg","hoverimage2.jpg"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').on('change','[data-group]',function(){ | |
var is_main = $(this).data('group-main'); | |
is_main = is_main || 0; | |
var group = $(this).data('group'); | |
var is_checked; | |
// Если дернули главный чекбокс | |
if(is_main) | |
{ | |
// если его отметили, то отметим все дочерние | |
is_checked = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').on('keydown','.validate_numeric',function(e){ | |
var specialKeys = new Array(); | |
specialKeys.push(8,37,39,46,190); | |
var keyCode = e.which ? e.which : e.keyCode; | |
cl(keyCode); | |
var ret = ((keyCode >= 48 && keyCode <= 57) || specialKeys.indexOf(keyCode) != -1); | |
if(!ret) | |
return false; | |
}); | |
// стрелки, цифры, бекспейс |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("a.scrollto").click(function () { | |
elementClick = $(this).attr("href") | |
destination = $(elementClick).offset().top; | |
$("html:not(:animated),body:not(:animated)").animate({scrollTop: destination}, 1100); | |
return false; | |
}); | |
}); | |
// add "<a href="#section-2" class="scrollto">Section 2</a>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(window.matchMedia('(max-width: 768px)').matches) { | |
$('.sub-menu-button').on('click',function(e) { | |
var subMenu = $(this).next('.sub-navigation'); | |
if(subMenu.is(':visible')) { | |
subMenu.slideUp(); | |
} else { | |
subMenu.slideDown(); | |
} | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if lt IE 9]> | |
<style> | |
.wrapper, footer, .header { | |
display: none; | |
} | |
body { | |
background: #fff; | |
} | |
</style> |