article ul,article ol{
list-style-type:none;
counter-reset:num;
margin:0 0 20px 0;
}
article ul li,article ol li{
list-style-type:none;
padding-left:20px;
margin-bottom:4px;
}
article ul li:before,article ol li:before{
color:#ffffff;
background:#ff9300;
border-radius:50%;
padding:0 5px;
text-align:center;
}
article ul li:before{
content:"•";
}
article ol li:before{
content:counter(num);
counter-increment:num;
}
LESS:
.article{
ul,ol{
list-style-type:none;
counter-reset:num;
margin:0 0 20px 0;
li{
list-style-type:none;
padding-left:20px;
margin-bottom:4px;
position:relative;
&:before{
position:absolute;
top:0;
left:0;
color:@color_link;
font-weight:600;
}
}
}
ul li:before{
content:"•";
}
ol li:before{
content:counter(num) ". ";
counter-increment:num;
}
}
Для того чтобы учитывался атрибут start у ol:
$('article ol').each(function(){
var start=parseInt($(this).attr('start'));
if(start>0){
$(this).css('counter-reset','num '+(start-1));
}
});
Сделать что либо с элементом зная его атрибут, например
<div data-u="slides"></div>
$('div[data-u=slides]').width(window_width+'px');
Усовершенствованное решение этого варианта: http://krylov.org.ua/?p=1130
.htaccess
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule . %1/%2 [R=301,L]
Работает для http://site.com/dir1///dir2
но проблема остается в адресах типа http://site.com///uri (несколько слешей после домена)
Решение на php:
if(stristr($_SERVER['REQUEST_URI'],'//')){
$uri=preg_replace('#/{2,}#','/',$_SERVER['REQUEST_URI']);
header('Location: '.$uri,false,301);
exit;
}
В примере необходимо генерировать в URL фильтрацию по цене только в том случае, если пользователь сам изменил ползунок выбора цены.
Т.е. нужно не передавать определенные параметры в _GET (по ситуации).
Часть формы (добавляем hidden поля):
<form method="get" action="" id="filter_form">
от <input type="text" name="price_from" id="price_from" value="100"/>
до <input type="text" name="price_to" id="price_to" value="1000"/>
<input type="hidden" id="price_min" value="100"/>
<input type="hidden" id="price_max" value="1000"/>
</form>
Яваскриптом дисаблим inputы, если их значения не меняли.
$(function(){
$("#filter_form").submit(function(){
if($("#price_from").val()==$("#price_min").val()){
$("#price_from").attr("disabled","disabled");
}
if($("#price_to").val()==$("#price_max").val()){
$("#price_to").attr("disabled","disabled");
}
});
});
В wincmd.ini
(по умолчанию в Windows 10 находится c:\Users\Konstantin\AppData\Roaming\GHISLER\wincmd.ini
)
в секции [Configuration]
- установить значение 0 у параметра
SortDirsByName=0
- добавить параметр
SortDirExt=1