Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть jQuery event object

  • kudvenkat
  • 2015-04-25
  • 53955
jQuery event object
convert javascript event to jqueryconvert javascript event to jquery eventconvert js event to jquery eventjquery event object examplejquery event object targetjquery mouse x y positionjquery event target tagnamejquery event target typejquery event target element typejquery tutorialjquery tutorial for beginners
  • ok logo

Скачать jQuery event object бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно jQuery event object или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку jQuery event object бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео jQuery event object

Link for all dot net and sql server video tutorial playlists
https://www.youtube.com/user/kudvenka...

Link for slides, code samples and text version of the video
http://csharp-video-tutorials.blogspo...

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.
   / @aarvikitchen5572  

In this video we will discuss
1. How to retrieve event data using event object
2. How to convert JavaScript event object to jQuery event object

Whenever an event (like click, mouseover, mouseout etc) occurs, the relevant data about that event is placed into the event object. For example, the event object contains event data like, the X and Y coordinates of the mouse pointer when the event occurred, the HTML element that fired the event, which mouse button is clicked etc.

Obtaining the event object is straightforward. The event object is always passed to the event handler method. Let us understand this with an example. When we click the button, we want to capture the following event data
1. Event name
2. Mouse X coordinate when the event occured
3. Mouse Y coordinate when the event occured
4. The control that raised the event
5. The HTML tag name that raised the event

Notice that in the example below, we are passing event object to getEventDetails() method. This object is the raw JavaScript event object. The type property gives us the event name that occured. pageX and pageY properties return the X and Y coordinates of the mouse pointer. Target property returns the HTML element that raised the event. Target, pageX and pageY properties are supported by all modern browsers and Internet Explorer 9 and above. The following code will not work in Internet Explorer 8 and earlier versions. In addition to click event, the following example returns mouseover and mouseout event data.

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 () {
$('#btn').click(function () {
getEventDetails(event);
}).mouseover(function () {
getEventDetails(event);
}).mouseout(function () {
getEventDetails(event);
});

function getEventDetails(event) {
var eventDetails = "Event = " + event.type +
"<br/> X = " + event.pageX + "<br/>Y = " +
event.pageY + "<br/>Target Type = " + event.target.type +
"<br/>Target Tag Name = " + event.target.tagName;

$('#divResult').html(eventDetails);
}
});
</script>
</head>
<body style="font-family:Arial">
<input id="btn" type="button" value="Click me" /><br /><br />
<div id="divResult"></div>
</body>
</html>

Cross-browser solution : For the above code to work in all browsers including Internet Explorer 8 and earlier versions, modify getEventDetails() function as shown below. Notice that we are converting JavaScript event object to jQuery event object using $.event.fix()

function getEventDetails(event) {
var e = $.event.fix(event);
var eventDetails = "Event = " + e.type +
"<br/> X = " + e.pageX + "<br/>Y = " +
e.pageY + "<br/>Target Type = " + e.target.type +
"<br/>Target Tag Name = " + e.target.tagName;

$('#divResult').html(eventDetails);
}

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]