$arSubQuery = array(
'>CATALOG_QUANTITY' => 0,
);
$arrFilter = array_merge(
array(
'ID' => CIBlockElement::SubQuery('PROPERTY_CML2_LINK', $arSubQuery)
)
);
$cmp = function ($a, $b) {
if ($a['time_ms']['value'] > $b['time_ms']['value'])
return -1;
if ($a['time_ms']['value'] < $b['time_ms']['value'])
return 1;
if ($a['laps'] > $b['laps'])
return 1;
};
usort($arr, $cmp);
<input type="submit" value="Нажми меня"/>
<input type="text" style="display: none;" />
$("input[type=submit]").click(function() {
$("input[type=text]").toggle();
});
$('body').on('mousedown', '.fav-add', function() {
$(this).removeClass('fav-add');
$(this).addClass('fav-remove');
});
$('body').on('mousedown', '.fav-remove', function() {
$(this).removeClass('fav-remove');
$(this).addClass('fav-add');
});