Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / проверка фокуса ввода / 14 сообщений из 14, страница 1 из 1
06.08.2007, 12:23
    #34707406
324f4
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
Добрый день! Мне нужно узнать, имеет ли фокус ввода элемент
Код: plaintext
<INPUT TYPE='text' id="my">
а также узнать, выходит ли курсор мыши за пределы элемента (например элемента
Код: plaintext
<SELECT id='my1'>
Получаем объекты тегов:
Код: plaintext
var TEXTS=document.getElementById("my");
Код: plaintext
var SELECTION = document.getElementById("my1");

Не подскажете, какие существуют функции/свойства для объектов, которые осуществляют эти проверки?
...
Рейтинг: 0 / 0
06.08.2007, 13:04
    #34707570
krvsa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
324f4Добрый день! Мне нужно узнать, имеет ли фокус ввода элемент
Код: plaintext
<INPUT TYPE='text' id="my">

Ответ тут
http://www.sql.ru/forum/actualthread.aspx?tid=459157
324f4Не подскажете, какие существуют функции/свойства для объектов, которые осуществляют эти проверки?
Про какие имено объекты идет речь? Про INPUT и SELECT? Или про метод getElementById объекта document?
У Методов нет ни свойств, ни методов (темболее функций)...
...
Рейтинг: 0 / 0
06.08.2007, 13:12
    #34707606
324f4
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
krvsa 324f4Добрый день! Мне нужно узнать, имеет ли фокус ввода элемент
Код: plaintext
<INPUT TYPE='text' id="my">

Ответ тут
http://www.sql.ru/forum/actualthread.aspx?tid=459157
324f4Не подскажете, какие существуют функции/свойства для объектов, которые осуществляют эти проверки?
Про какие имено объекты идет речь? Про INPUT и SELECT? Или про метод getElementById объекта document?
У Методов нет ни свойств, ни методов (темболее функций)...
Спасибо, сейчас посмотрим ссылку) Речь идет про объекты TEXTS и SELECTION
...
Рейтинг: 0 / 0
06.08.2007, 13:15
    #34707621
krvsa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
А какие проверки ты хочеш выполнить?
----------
Cache for Windows NT (Intel) 5.0.20 (Build 6305) Fri Sep 16 2005 11:54:10 EDT
...
Рейтинг: 0 / 0
06.08.2007, 13:18
    #34707629
krvsa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
Вот например методы для <input type='text'>
документацияAllAttributesPropertiesMethodsEventsCollectionsBehaviors Description
addBehavior Attaches a behavior to an <INPUT>.
appendChild Appends an element as a child to the <INPUT>.
applyElement Makes the <INPUT> either a child or parent of the <INPUT>.
attachEvent Binds the specified function to an event that fires on the <INPUT> when the function is called.
blur Causes an object to lose focus, and fires the onblur event.
clearAttributes Removes all attributes and values from the <INPUT>.
click Simulates a click by causing the onclick event to fire.
cloneNode Copies a reference to the <INPUT> from the document hierarchy.
componentFromPoint Returns the component located at the specified coordinates.
contains Checks whether the given element is contained within the <INPUT>.
createTextRange Creates a TextRange object for the given object.
detachEvent Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires on the <INPUT>.
dragDrop Initiates a drag event.
fireEvent Fires a specified event on the <INPUT>.
focus Causes a control to receive the focus, and executes the code specified by the onfocus event.
getAdjacentText Returns the adjacent text character.
getAttribute Retrieves the value of the specified attribute.
getBoundingClientRect Retrieves an object specifying the bounds of a collection of TextRectangle objects.
getClientRects Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line.
getExpression Retrieves the expression for the given property.
hasChildNodes Returns whether the <INPUT> has children.
insertAdjacentElement Inserts an element at the specified location.
insertAdjacentHTML Inserts the given HTML text into the element at the location.
insertAdjacentText Inserts the given text into the element at the specified location.
insertBefore Inserts an element into the document hierarchy.
mergeAttributes Copies all read/write attributes to the specified element.
releaseCapture Removes mouse capture from the <INPUT> in the current document.
removeAttribute Removes the given attribute from the <INPUT>.
removeBehavior Detaches a behavior from the <INPUT>.
removeChild Removes a child node from an element.
removeExpression Removes the expression from the specified property.
removeNode Removes the <INPUT> from the document hierarchy.
replaceAdjacentText Replaces the adjacent text character.
replaceChild Replaces an existing child element with a new child element.
replaceNode Replaces the <INPUT> with another element.
scrollIntoView Causes the <INPUT> to scroll into view, aligning it either at the top or bottom of the window.
select Highlights the input area of a form element.
setActive Sets the <INPUT> as the current object without setting focus to the object.
setAttribute Sets the value of the specified attribute.
setCapture Sets the mouse capture to the <INPUT> belonging to the current document.
setExpression Sets an expression for the specified object.
swapNode Exchanges the location of two objects in the document hierarchy.

----------
Cache for Windows NT (Intel) 5.0.20 (Build 6305) Fri Sep 16 2005 11:54:10 EDT
...
Рейтинг: 0 / 0
06.08.2007, 13:20
    #34707637
krvsa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
Вот методы <select>
документацияAllAttributesPropertiesMethodsEventsCollectionsBehaviors Description
addBehavior Attaches a behavior to an <SELECT>.
appendChild Appends an element as a child to the <SELECT>.
applyElement Makes the <SELECT> either a child or parent of the <SELECT>.
attachEvent Binds the specified function to an event that fires on the <SELECT> when the function is called.
blur Causes an object to lose focus, and fires the onblur event.
clearAttributes Removes all attributes and values from the <SELECT>.
click Simulates a click by causing the onclick event to fire.
cloneNode Copies a reference to the <SELECT> from the document hierarchy.
componentFromPoint Returns the component located at the specified coordinates.
contains Checks whether the given element is contained within the <SELECT>.
detachEvent Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires on the <SELECT>.
dragDrop Initiates a drag event.
fireEvent Fires a specified event on the <SELECT>.
focus Causes a control to receive the focus, and executes the code specified by the onfocus event.
getAdjacentText Returns the adjacent text character.
getAttribute Retrieves the value of the specified attribute.
getBoundingClientRect Retrieves an object specifying the bounds of a collection of TextRectangle objects.
getClientRects Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line.
getElementsByTagName Retrieves a collection of objects based on the specified element name.
getExpression Retrieves the expression for the given property.
hasChildNodes Returns whether the <SELECT> has children.
insertAdjacentElement Inserts an element at the specified location.
insertAdjacentHTML Inserts the given HTML text into the element at the location.
insertAdjacentText Inserts the given text into the element at the specified location.
insertBefore Inserts an element into the document hierarchy.
mergeAttributes Copies all read/write attributes to the specified element.
releaseCapture Removes mouse capture from the <SELECT> in the current document.
removeAttribute Removes the given attribute from the <SELECT>.
removeBehavior Detaches a behavior from the <SELECT>.
removeChild Removes a child node from an element.
removeExpression Removes the expression from the specified property.
removeNode Removes the <SELECT> from the document hierarchy.
replaceAdjacentText Replaces the adjacent text character.
replaceChild Replaces an existing child element with a new child element.
replaceNode Replaces the <SELECT> with another element.
scrollIntoView Causes the <SELECT> to scroll into view, aligning it either at the top or bottom of the window.
setActive Sets the <SELECT> as the current object without setting focus to the object.
setAttribute Sets the value of the specified attribute.
setCapture Sets the mouse capture to the <SELECT> belonging to the current document.
setExpression Sets an expression for the specified object.
swapNode Exchanges the location of two objects in the document hierarchy.
urns Retrieves a collection of all objects to which a specified behavior is attached.

----------
Cache for Windows NT (Intel) 5.0.20 (Build 6305) Fri Sep 16 2005 11:54:10 EDT
...
Рейтинг: 0 / 0
06.08.2007, 14:57
    #34707991
Antonariy
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
Что за бестолковые копипасты?

Для проверки фокуса - TEXTS==document.activeElement
Для проверки курсора мыши - в какой момент?
...
Рейтинг: 0 / 0
06.08.2007, 15:11
    #34708050
krvsa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
AntonariyЧто за бестолковые копипасты?
Редактировать не хотелось... :)
...
Рейтинг: 0 / 0
06.08.2007, 17:20
    #34708567
Antonariy
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
А подумать хотелось? В этих текстах нет ни капли плезной информации.
...
Рейтинг: 0 / 0
07.08.2007, 05:51
    #34709248
LINUXER
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
324f4
Не подскажете, какие существуют функции/свойства для объектов, которые осуществляют эти проверки?
нету таких
напишите свои, обрабатывая события
onfocus - onblur;
onmouseover - onmouseout
...
Рейтинг: 0 / 0
07.08.2007, 08:21
    #34709339
Блок А.Н.
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
Еще есть такое

document.activeElement
...
Рейтинг: 0 / 0
07.08.2007, 10:12
    #34709585
krvsa
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
AntonariyА подумать хотелось? В этих текстах нет ни капли плезной информации.
Это не так... Там перечислены все методы объектов.
...
Рейтинг: 0 / 0
07.08.2007, 12:07
    #34710139
LINUXER
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
Блок А.Н.Еще есть такое

document.activeElement
да для ИЕ это
...
Рейтинг: 0 / 0
07.08.2007, 12:17
    #34710188
LINUXER
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
проверка фокуса ввода
LINUXERда для ИЕ это
ой не только, но в ФФ не пашет
...
Рейтинг: 0 / 0
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / проверка фокуса ввода / 14 сообщений из 14, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]