Skip to content

Instantly share code, notes, and snippets.

$('form').submit(function(e) {
e.preventDefault();
var name = $(this).find('.name').val();
$.post(
'mail.php', {
name: name,
},
function(d) {
@vgrish
vgrish / common.js
Last active March 11, 2016 10:28 — forked from Ibochkarev/common.js
scrollCurrentLink
$(document).ready(function () {
$(document).on("scroll", onScroll);
//smoothscroll
$('a[href^="#"][data-anchor="1"]').on('click', function (e) {
e.preventDefault();
$(document).off("scroll");
$('a').each(function () {
$(this).removeClass('active');
@vgrish
vgrish / gist:190d3313253a7af6d63e
Created February 27, 2016 20:38 — forked from francoishill/gist:6483997
Media queries for mobile devices - Requires at least requires the meta viewport tag with content 'width=device-width'
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
<?php
$id = $modx->resource->get('id');
$q = $modx->newQuery('modResource');
$q->where(array('template'=>3, 'published'=>1, 'deleted:!='=>1));
$q->sortby('menuindex', 'ASC');
$q->select('id,uri');
if ($q->prepare() && $q->stmt->execute()) {
$projects = $q->stmt->fetchAll(2);
<?php
echo "<pre>";
$modx->switchContext('web');
$modx->invokeEvent('OnHandleRequest');
if (!$twiggy = $modx->getService('twiggy', 'twiggy', $modx->getOption('twiggy_core_path', null, $modx->getOption('core_path') . 'components/twiggy/') . 'model/twiggy/')) {
return 'Could not load twiggy class!';
}
<?php
echo "<pre>";
$modx->switchContext('web');
$modx->invokeEvent('OnHandleRequest');
if (!$twiggy = $modx->getService('twiggy', 'twiggy', $modx->getOption('twiggy_core_path', null, $modx->getOption('core_path') . 'components/twiggy/') . 'model/twiggy/')) {
return 'Could not load twiggy class!';
}
$('select[name="options[size]"]').on("change", function(e) {
var $this = $(this);
var forma = $(this).closest('.ms2_form').find('select[name="options[forma_zakaza]"]');
if (!!forma) {
forma.prop('disabled', true);
}
});
/** v.1.1.0 -- */
msfavorites = {
options: {
selector: '.msfavorites',
add: '.msfavorites-add',
remove: '.msfavorites-remove',
go: '.msfavorites-go',
total: '.msfavorites-total',
element: '.ms2_product',
.modal {
/*! adjust transition time */
-webkit-transition: all ease-out !important;
-moz-transition: all 0.3s ease-out !important;
-o-transition: all 0.3s ease-out !important;
transition: all 0.3s ease-out !important;
}
.modal.in .modal-dialog {
/*! editthis transform to any transform you want */
-webkit-transform: scale(1, 1) !important;
<?php
/**
* Update Prices an CRlist
*/
class modCRlistsUpdatePricesProcessor extends modProcessor
{
public $classKey = 'CRlist';
public $message = array();
public $total = 0;
protected $valutes = array(