switch ($data['sort']) {
case 'pd.name':
case 'p.price':
case 'p.model':
$field = str_ireplace(array('p.', 'pd.'), '', $data['sort']);
$sortMode = constant('SPH_SORT_ATTR_' . strtoupper($data['order']));
$sphinxClient->SetSortMode(SPH_SORT_EXTENDED, 'quantity DESC, ' . $field .' '. strtoupper($data['order']) );
break;
default:
$sphinxClient->SetSortMode(SPH_SORT_EXTENDED, 'quantity DESC, @relevance DESC');
break;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Velocity.js</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="block"></div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="velocity.min.js"></script>
<script src="velocity.ui.min.js"></script>
<script src="script.js"></script>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-size: 16px;
min-width: 320px;
width: 100%;
overflow-x: hidden;
}
.block {
width: 50px;
padding: 50px;
background-color: green;
border-radius: 100%;
}
'use strict';
jQuery(document).ready(function($) {
var option = {
scale: 1.2
};
var duration = {
duration: 3000,
};
$('.block').velocity(option, duration);
});