jQuery scroll event
Link for all dot net and sql server video tutorial playlists
https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1
Link for slides, code samples and text version of the video
http://csharp-video-tutorials.blogspot.com/2015/05/jquery-scroll-event.html
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1
In this video we will discuss scroll event and how to handle it using jQuery.
scroll event is raised when the user scrolls to a different place in the element. It applies to window objects, but also to scrollable frames and elements with the overflow CSS property set to scroll.
In the following exampe, notice that the div element overflow style is set to scroll. The div element has a scrollbar and as you scroll up and down the div element, the scroll event is raised and handled.
Replace ﹤ with LESSTHAN symbol and ﹥ with GREATERTHAN symbol
﹤html﹥
﹤head﹥
﹤title﹥﹤/title﹥
﹤script src="jquery-1.11.2.js"﹥﹤/script﹥
﹤script type="text/javascript"﹥
$(document).ready(function () {
$('div').scroll(function () {
$('h3').css('display', 'inline').fadeOut(1000);
});
});
﹤/script﹥
﹤/head﹥
﹤body style="font-family:Arial"﹥
﹤div style="width:300px; height:200px; border:1px solid black; overflow:scroll"﹥
PRAGIM Speciality in training arena unlike other training institutions. Training delivered by real time software experts having more than 10 years of experience. Interview questions and real time scenarios discussion on topics covered for the day. Realtime projects discussion relating to the possible interview questions. Trainees can attend training and use lab untill you get a job. Resume preperation and mock up interviews. 100% placement assistance. 24 hours lab facility. PRAGIM Technologies offers professional real time projects for studetns in their final semester. Course completion and project completion certificates will also be provided upon successful completion of the course. We have partnered with major multinational companies to place freshers with our clients on their course completion.
﹤/div﹥
﹤br /﹥
﹤h3 style="display:none; color:red"﹥Scroll event handled﹤/h3﹥
﹤/body﹥
﹤/html﹥
The following example, keeps track of how many times the scroll event is raised.
﹤html﹥
﹤head﹥
﹤title﹥﹤/title﹥
﹤script src="jquery-1.11.2.js"﹥﹤/script﹥
﹤script type="text/javascript"﹥
$(document).ready(function () {
var count = 0;
$('div').scroll(function () {
$('span').text(count += 1);
});
});
﹤/script﹥
﹤/head﹥
﹤body style="font-family:Arial"﹥
﹤div style="width:300px; height:200px; border:1px solid black; overflow:scroll"﹥
DIV CONTENT
﹤/div﹥
﹤br /﹥
﹤h3 style="color:red"﹥Scroll event handled ﹤span﹥0﹤/span﹥ time(s)﹤/h3﹥
﹤/body﹥
﹤/html﹥
The following example, keeps track of whether the user scrolled up or down.
﹤html﹥
﹤head﹥
﹤script src="jquery-1.11.2.js"﹥﹤/script﹥
﹤script type="text/javascript"﹥
$(document).ready(function () {
var lastScrollTop = 0;
$('div').scroll(function () {
var currentScrollPosition = $(this).scrollTop();
if (currentScrollPosition ﹥ lastScrollTop) {
$('h3').text('You scrolled down');
} else {
$('h3').text('You scrolled up');
}
lastScrollTop = currentScrollPosition;
});
});
﹤/script﹥
﹤/head﹥
﹤body style="font-family:Arial"﹥
﹤div style="width:300px; height:200px; border:1px solid black; overflow:scroll"﹥
DIV CONTENT
﹤/div﹥
﹤br /﹥
﹤h3 style="display:inline; color:red"﹥﹤/h3﹥
﹤/body﹥
﹤/html﹥
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «jQuery scroll event», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.