Действия колесиком мышки
Всем привет. Сегодня я сделаю обзор интересного плагина для управления значениями полей форм с помощью колесика мышки. Решения мне нравится тем, что некоторые формы можно будет заполнять только с помощью мышки, а это выглядит просто классно.
Теперь перейдем к технической реализации. Для этого на понадобится jQuery и пара плагинов к нему, такиех как MouseWheel Plugin и небольшому плагину от css trick.
Для начала создадим поле с которым мы будем работать:
<div>
<label for="how-many">How Many? </label>
<input type="text" id="how-many" class="wheelable" value="1" name="how-many" />
</div>
Теперь подключим все необходимы javascript библиотеки:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
<script type="text/javascript" src="js/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="js/increment.js"></script>
Теперь применим к нашему полю эти скрипты:
$(function() {
$("div").append('<img src="images/mousewheelupdown.png" alt="Scroll up or down with mousewheel" />');
$("#how-many").bind("mousewheel", function(event, delta) {
if (delta > 0) {
this.value = parseInt(this.value) + 1;
}
else {
if (parseInt(this.value) > 0) {
this.value = parseInt(this.value) - 1;
}
} return false; });
});
Готово! Все работает, сами смотрите что вышло.
Так же можно изменять не только численные значения:
$("#whale").bind("mousewheel", function(event, delta) {
if (this.value == "Blue") {
this.value = "Sperm";
}
else if (this.value == "Sperm") {
this.value = "Orca";
}
else if (this.value == "Orca") {
this.value = "Humpback";
}
else if (this.value == "Humpback") {
this.value = "Blue"; } return false;
});
Так что это можно использовать почти в любой вашей форме.
Думаю, применить к своим проектам данные наработки не составит труда - зато такая приятная мелочь для пользователей!


Очень шЫкарно, не ожидал увидеть новый контрол :)
До конца читал и думал укажешь автора или нет :D
Но на практике сложно представить где это может пригодиться. Возраст проще ввести, а при выборе страны допустим или любого другого пункта меню нет самого нужного – отображения местоположения.
Оригинально, но с точки зрения юзабилити думаю, что сложновато. Как элемент улучшения может и подойти.
С числами интересный вариант, а со словами аналог комбобокса, еще бы автозаполнение добавить… )
А что делать, если в лисе не работает сие чудо?
Работает только если кликнуть в поле ввода, а потом крутит колесо. Если кликнуть в лейбле – не работает.
Нет, не так. работает, только когда курсор над полем. Если бы работало при фокусе на поле – было бы интересно. А так – только путает:)
Креативное решение! Но чую не все браузеры воспримут.
Наверно, рано ещё такое внедрять. А так идея очень даже хорошая, клаву скоро вообще выкинем
Должно во всех браузерах работать, это же jQuery. А автора действительно хотелось бы узнать)
Ах, сразу ссылку не увидел, только комментарий Dr.Death
Спасибо за интересное новое)
Кто же автор?
Я считаю что юзабеьность для обычного пользователя под большим вопросом.
Решение действительно креативное, мне бы такое в голову никогда не пришло
Мысль конечно интересная, но для пользователей она будет странной, и не сразу поймут в чем дело.
А я все-таки попробую куда-нибудь это втулить.
Спасибо за статью
Хы… действительно круто) надо будет на досуге прикрутить к своему сайту
Как-то даже странно, что это не поведение по умолчанию в браузерах
i like it
Действия колесиком мышки | Чернев.ру now im your rss reader
Твитанул, отличный пост.
Как на счет мультибраузерности? Кто-нибудь тестил?
Да, действительно полезный плагин
Google проводит реформы. Изменений подверглась главная страница сайта и форма поиска. Теперь мы не сможем открыть первую найденную страницу с помощью кнопки «мне повезет». Сама форма поиска теперь будет синего цвета. 060b8c849e6fbc7f379ef1800dda5cb3
Пока данные изменения внедряются в финском Google.
Don’t you acknowledge that this is correct time to receive thecredit loans , which would make your dreams come true.
Пригодится, большое спасибо!
Different people all over the world get the credit loans in different banks, just because it’s easy.
строительство выставочных стендов
автоматический полив
свадьба в Магнитогорске
поисковое продвижение
постер из фильма
Интересно тут у Вас, есть что почитать)
Огромное вам спасибо. Искал решение давно, а оно было не таким сложным. Буду частным гостем.
i like it
What i acquire problematic will be to look for a website that will seize me for your minute but your web site is different. Bravo.
Magnificent goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I’ve understand your stuff previous to and you’re just too magnificent. I really like what you have acquired here, certainly like what you are saying and the way in which you say it. You make it enjoyable and you still take care of to keep it wise. I can not wait to read far more from you. This is actually a great ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
Wonderful goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I’ve understand your stuff previous to and you are just too excellent. I really like what you have acquired here, really like what you’re stating and the way in which you say it. You make it entertaining and you still take care of to keep it sensible. I cant wait to read far more from you. This is actually a wonderful ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
Let’s be real that woman can’t possible supply enough milk to nourish that baby calf. She’s wasting her efforts and is only doing it as a symbolic gesture. I just pray the cow doesn’t chew of her nipple when it starts teething
Wonderful goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I have understand your stuff previous to and you are just extremely great. I really like what you have acquired here, certainly like what you’re saying and the way in which you say it. You make it entertaining and you still care for to keep it wise. I can not wait to read much more from you. This is really a tremendous ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
Magnificent goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I have understand your stuff previous to and you are just too wonderful. I actually like what you have acquired here, certainly like what you’re stating and the way in which you say it. You make it enjoyable and you still take care of to keep it wise. I can’t wait to read much more from you. This is really a great ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
Great goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I’ve understand your stuff previous to and you’re just too magnificent. I actually like what you have acquired here, certainly like what you are stating and the way in which you say it. You make it entertaining and you still care for to keep it wise. I can not wait to read far more from you. This is really a terrific ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
Magnificent goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I have understand your stuff previous to and you are just too excellent. I really like what you have acquired here, certainly like what you are saying and the way in which you say it. You make it enjoyable and you still take care of to keep it sensible. I can not wait to read far more from you. This is really a wonderful ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
Wow, incredible blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is wonderful, let alone the content!. Thanks For Your article about ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру .
Wonderful goods from you, man. ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I have understand your stuff previous to and you are just too great. I really like what you’ve acquired here, certainly like what you are stating and the way in which you say it. You make it entertaining and you still take care of to keep it wise. I can’t wait to read much more from you. This is actually a terrific ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру informations.
An intriguing treatment is worth note. I conceive that you should correspond many on this subject, it might not be a sacred individual but mostly group are not enough to speak on specified topics. To the next. Cheers like your ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру.
An fascinating speech is couturier remark. I suppose that you should correspond much on this substance, it strength not be a taboo thing but generally group are not enough to mouth on much topics. To the succeeding. Cheers like your ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру.
An gripping communication is designer scuttlebutt. I consider that you should pen much on this message, it mightiness not be a sacred someone but mostly people are not enough to speak on much topics. To the succeeding. Cheers like your ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру.
An fascinating speech is couturier annotate. I cogitate that you should create much on this issue, it strength not be a sacred bailiwick but mostly group are not sufficiency to mouth on much topics. To the succeeding. Cheers like your ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру.
I got what you think, thanks for swing up. Woh I am glad to effort this website through google. Thanks For Share ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру.
ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру I was recommended this blog by my cousin. I’m not sure whether this post is written by him as no one else know such detailed about my problem. You are amazing! Thanks! your article about ДейÑÑ‚Ð²Ð¸Ñ ÐºÐ¾Ð»ÐµÑиком мышки | Чернев.ру Best Regards Yoder Agata