class Router extends Module
<div class="result pointer" onclick="jump(this);" style="background:#eee; display: inline-block; padding: 5px;">
Прыгучий объект
</div>
<script type="text/javascript">
function jump (el) {
el.style.position='relative';
var i=0, an= setInterval(function() {
if (i>=Math.PI) {
clearInterval(an);
el.style.top= 0;
} else el.style.top= -100*Math.sin(i) + 'px';
i+=.1;
},25)
}
</script>
var pattern = /^.+\s.+\s?.*$/i;
if(pattern.test("фамилия имя отчество")) console.log(1);
if(pattern.test("фамилия имя")) console.log(2);
Тогда код нужен. Возможно, нужно суммировать ширины подблоков, возможно - брать ширину родителького блока. Короче, дальше камлание с бубном начинается.
Выложите в codepen свой пример.