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
$.placeHolder = function(input, text) { | |
var _input = $(input), | |
_class = 'placeholder'; | |
_value = _input.val(); | |
_input | |
.focus(function() { | |
_value = $(this).val(); | |
$(this) | |
.removeClass(_class) | |
.val(_value == text ? '' : _value) |
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
// See from http://chris-barr.com/files/touchScroll.htm | |
var isTouchDevice = function(){ | |
try { | |
document.createEvent("TouchEvent"); | |
return true; | |
} catch(e) { | |
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
/* | |
Example: | |
$('div') | |
.viewport() | |
.one('viewport', function() { | |
$(this).addClass('view'); | |
}); | |
*/ | |
(function($) { | |
$.fn.viewport = function() { |
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
function fireCustomEvent(eventType) { | |
if ( document.dispatchEvent ) { // DOM browser | |
var e = document.createEvent("UIEvents"); | |
e.initEvent(eventType, false, false); | |
document.dispatchEvent(e); | |
} else if ( document.attachEvent ) { // IE | |
if ( !document.documentElement[eventType] ) | |
document.documentElement[eventType] = 1; | |
else | |
document.documentElement[eventType] += 1; |
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
tools.htmlToText = function(html) { | |
var node = document.createElement('b'); | |
node.innerHTML = html; | |
return node.innerText || node.textContent || ''; | |
} |
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
jQuery.fn.renew = function() { | |
return $(this.selector); | |
}; | |
$('div').renew(); |
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
var | |
/** | |
* @constructor | |
* @description Базовый класс, от которого наследуется деструктор объектов | |
*/ | |
Root = function() { | |
}; | |
Root.prototype = { |
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
/** | |
* @ignore | |
* @description Вычисление расстояния D от точки p, до отрезка, задаваемоого точками p1 и p2 | |
* @description Также вычисляются координаты точки пересечения (xN, yN) перпендикуляра, проведенного из точки к отрезку | |
* @description Если точка пересечение лежит вне отрезка, или отрезок нулевой длины - вернется false | |
*/ | |
vertical: function(p1, p2, p) { | |
var x1 = p1.lon, | |
y1 = p1.lat, | |
x2 = p2.lon, |
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
<!DOCTYPE html> | |
<html lang="ru-RU" class="noscroll index"> | |
<head> | |
<meta charset="utf-8"> | |
<title>POST</title> | |
<script src="http://maps.mail.ru/js/jquery-1.7.1.min.js"></script> | |
<script> | |
// Docs: http://api.jquery.com/jQuery.post/ | |
jQuery.post('/url', { data: 'jsondata' }, function() { | |
alert('Success!'); |
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
(function() { | |
if ( | |
!window.console || | |
!console.log | |
) return; | |
var eventList = [ | |
/* Список событий */ | |
]; |
OlderNewer