Javascript-форум (https://javascript.ru/forum/)
-   Opera, Safari и др. (https://javascript.ru/forum/css-html-browser/)
-   -   как создать popup (https://javascript.ru/forum/css-html-browser/31383-kak-sozdat-popup.html)

timofey77 05.09.2012 16:57

как создать popup
 
Пожалуйста подскажите (не силен по этой части) как на javascript создать всплывающее окно с текстом на определенном расстоянии (выше) указателя в Опере 12? Окно должно появляться при выделении текста.

P.s. пожалуйста, дайте конкретный ответ, а не ссылку. sorry

Positive_fun 05.09.2012 17:29

Ты имеешь виду хинты? Типо всплывающая подсказка или расшифровка текста?

timofey77 09.09.2012 12:47

Именно всплывающая подсказка.

Хотя-бы в общих чертах решение.

timofey77 10.09.2012 21:47

Цитата:

Сообщение от timofey77 (Сообщение 203752)

Хотя-бы в общих чертах решение.

:help:

bes 10.09.2012 23:19

хром
<input value="select some text">
<div style="position: absolute; display: none; background: lightgrey; color: green"</div>

<script>

	document.body.children[0].onmousedown = function () {
		this.onmousemove = function (e) {
			e = e || event; 
			this.nextElementSibling.innerHTML = document.getSelection();
			var hint = this.nextElementSibling;
			hint.style.display = 'block';
			hint.style.left = e.clientX + 'px';
			hint.style.top = e.clientY + 10 + 'px';
		}
		this.onmouseout = function () {
			this.nextElementSibling.style.display = 'none';
			this.onmouseout = null;
			this.onmousemove = null;
		}
		this.onmouseup = function () {
			this.nextElementSibling.style.display = 'none';
			this.onmouseup = null;
			this.onmousemove = null;

		}
	}

</script>

timofey77 11.09.2012 18:32

Спасибо.


Часовой пояс GMT +3, время: 14:36.