Skip to content

Instantly share code, notes, and snippets.

var $price = $(".woocommerce-Price-amount");
$price.each(function(index, item) {
var $this = $(item);
var text = $this.clone().children().remove().end().text();
var $currency = $this.find(".woocommerce-Price-currencySymbol");
$this.html(Number(text.replace(/[^0-9\.-]+/g,""))).append($currency);
});
@Security2431
Security2431 / modx
Last active May 28, 2018 11:20
modx feature
1. anchor scroll
`<a href="[[~[[*id]]]]#anchor[[+idx]]" class="sv-list__link" data-scroll-to>[[+city]]</a>`
`[[~[[*id]]]]` - link of current page;
`[[+idx]]` - order, starting with 1;
2. anchor links `[[!++site_url]]category/[[*alias]]/#review`
useful resources:
footer.footer
.wrapper.footer__wrapper
.footer__col
.footer__head
.footer__payment
.footer__info
.footer__col
- var menu = content.index.menu
each items in menu.items
@Security2431
Security2431 / gsap-resources.js
Created September 29, 2017 13:46 — forked from cameronrye/gsap-resources.js
GASP Resources
// Position parameters
var tl = new TimelineLite();
tl.to(".orange", 1, {x:750})
//this just follows the first
.to(".green", 1, {x:750})
//there is a one second gap between these two tweens
.to(".blue", 1, {x:750}, "+=1")
//this goes to two seconds in
.to(".red", 1, {x:750}, "2")
@Security2431
Security2431 / Checkbox custom
Last active August 23, 2017 07:34
radio/checkbox with custom styles
<div class="checkbox-btn">
<input class="checkbox-btn__control" type="radio" name="package" id="package-1">
<label class="checkbox-btn__box" for="package-1">btn 1</label>
</div>
/**!
* easyPieChart
* Lightweight plugin to render simple, animated and retina optimized pie charts
*
* @license
* @author Robert Fleischmann <[email protected]> (http://robert-fleischmann.de)
* @version 2.1.6
**/
(function(root, factory) {
// Today date
$(function () {
Date.prototype.addDays = function(days) {
this.setDate(this.getDate() + parseInt(days));
return this;
};
Date.prototype.format = function(format) {
// set default format if function argument not provided
format = format || 'YYYY-MM-DD hh:mm';
.loader-wrapper {
position: fixed;
z-index: 9999;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: url(http://img1.wikia.nocookie.net/__cb20140415002935/bajoterra-babosas-y-otros/es/images/a/af/Youtube.png) center center no-repeat #012a77;
-webkit-background-size: 100px 100px;
background-size: 100px 100px;
// Slick slider
if ($('#carousel-header').length) {
$('#carousel-header').slick({
dots: true,
arrows: false,
infinite: true,
slidesToShow: 1,
speed: 500,
mobileFirst: true,
swipeToSlide: '15',
<section class="service">
<div class="service__heading">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2 class="pull-left service__title">Наши услуги</h2>
<div class="pull-right rss"><a href="#" class="rss__link"><i class="fa fa-rss rss__icon"></i><span class="hidden-xs rss__text">RSS-лента</span></a></div>
</div>
</div>
</div>