function testJump(x){
var ml = ~~x.getAttribute('maxlength');
if(ml && x.value.length >= ml){
do{
x = x.nextSibling;
}
while(x && !(/text/.test(x.type)));
if(x && /text/.test(x.type)){
x.focus();
}
}
}
<div>
<input type="text" onkeyup="testJump(this);" maxlength="2" size="2">
<input type="text" onkeyup="testJump(this);" maxlength="3" size="3">
<input type="text" onkeyup="testJump(this);" maxlength="7" size="7">
</div>
$('.controller').on('click', function(){
$this = $(this);
$target = $this.siblings('.tall').eq(0);
if($this.hasClass('less')){
$target.animate({
height: xpander_init+'px',
}, function(){
$this.removeClass('less').addClass('more');
$this.find('span').text('Подробнее');
$this.trigger('scrollto');
});
}else if($this.hasClass('more')){
$target.animate({
height: $target.data('init-hg')+'px',
}, function(){
$this.removeClass('more').addClass('less');
$this.find('span').text('Скрыть');
$this.trigger('scrollto');
});
}
return false;
}).on('scrollto', function(){
$('body, html').animate({
scrollTop: $(this).offset().top -
(window.innerHeight - $this.height()*2),
}, 600);
});
<div class="number">
<span class="minus">-</span>
<input type="text" value="1" size="5"/>
<span class="plus">+</span>
</div>
<script type="text/javascript" >
$(document).ready(function() {
$('.minus').click(function () {
var $input = $(this).parent().find('input');
var count = parseInt($input.val()) - 1;
count = count < 1 ? 1 : count;
$input.val(count);
$input.change();
return false;
});
$('.plus').click(function () {
var $input = $(this).parent().find('input');
$input.val(parseInt($input.val()) + 1);
$input.change();
return false;
});
});