Используется border-image-source и border-image-slice

header{
	height:800px;
	background:url("../images/header.jpg") no-repeat top center;
	background-size:cover;
	box-sizing:border-box;
	padding-top:80px;
	position:relative;
	&:after,&:before{
		content:'';
		display:block;
		width:~"calc(100% - 60px)";
		height:~"calc(100% - 45px)";
		position:absolute;
		border:3px solid @color_gold;
		border-image-source:linear-gradient(90deg,#dcae72 0%,#f9a73b 27.72%,#dcae72 54.07%,#ee8f13 78.85%,#dcae72 101.19%);
		border-image-slice:1;
		box-sizing:border-box;
	}
	&:after{
		top:15px;
		left:20px;
	}
	&:before{
		top:30px;
		left:40px;
	}
}
Categories: CSS Tags:

Для тени используется -webkit-filter вместо text-shadow

.l1,.l2{
	background:linear-gradient(91.72deg,#ffce8f 3.54%,#f9a73b 24.85%,#f9a73b 35.35%,#ad6e24 41.86%,#ee8f13 50.91%,#ffb452 76.88%,#ae6402 99.59%);
	-webkit-text-fill-color:transparent;
	-webkit-background-clip:text;
	-webkit-filter:drop-shadow(1px 1px @color_black);
}
Categories: CSS Tags:
var char_timeout=50;
var story_timeout=2000;
var placeholders=new Array();
	placeholders[0]='труба';
	placeholders[1]='проточный водонагреватель';
	placeholders[2]='фильтр';
	placeholders[3]='бак';
	placeholders[4]='сифон';
	placeholders[5]='теплый пол';
	placeholders[6]='душевая кабина';
	placeholders[7]='емкость';
	placeholders[8]='горелка';
	placeholders[9]='арматура';
	placeholders[10]='бойлер';
	placeholders[11]='газовый котел';
	placeholders[12]='наcос';
function start_printing(){
	item_count=Number(placeholders.length);
	current_placeholder=-1;
	current_length=0;
	input=$('input[name=search_string]');
	run_printing();
}
function run_printing(){
	var timeout;
	if(current_length==0){
		current_placeholder++;
		current_placeholder=current_placeholder%item_count;
		placeholder=placeholders[current_placeholder].replace(/"/g,'-');
	}
	input.attr('placeholder',placeholder.substring(0,current_length)+current_char());
	if(current_length!=placeholder.length){
		current_length++;
		timeout=char_timeout;
	}
	else{
		current_length=0;
		timeout=story_timeout;
	}
	setTimeout("run_printing()",timeout);
}
function current_char(){
	if(current_length==placeholder.length){
		return "";
	}
	else{
		return "|";
	}
}
start_printing();
Categories: Javascript Tags:
$('input[type=number]').keyup(function(){
	var max=parseInt($(this).attr('max'));
	var min=parseInt($(this).attr('min'));
	var val=$(this).val();
	if(val<min){
		$(this).val(min);
	}
	if(val>max){
		$(this).val(max);
	}
});
Categories: Javascript Tags:
try{
	var result=JSON.parse(r);
	//...
}
catch(e){
}
Categories: Javascript Tags:
$(".element").prop("clientWidth");
//или
$(".element").prop("scrollWidth");

вместо

$('.element').width()
Categories: Javascript Tags:
(function($){
	$.widget("ui.onDelayedKeyup",{
		_init:function(){
			var self=this;
			$(this.element).keyup(function(){
				if(typeof(window['inputTimeout'])!="undefined"){
					window.clearTimeout(inputTimeout);
				}
				var handler=self.options.handler;
				window['inputTimeout']=window.setTimeout(function(){
					handler.call(self.element)
				},self.options.delay);
			});
		},
		options:{
			handler:$.noop(),
			delay:500
		}
	});
})(jQuery);
$('header .search input[type=text]').onDelayedKeyup({
	handler:function(){
		var string=$(this).val();
		if(string.length>3){
			//.......
		}
	},
	delay:1000
});
Categories: Javascript Tags: