2014年5月18日星期日

Advice on how to achieve mouseover prompt box , anxious ! ! !

when the mouse hovers over an item, the interface automatically pops up a small window , there are some simple words , after the mouse away , a small window disappears. Like the windows system , the mouse stops on the icon of a file or folder , then, appears next to the mouse , like a small balloon . Please provide an example of people are extremely grateful ! ! ! ! !
------ Solution ---------------------------------------- ----
is this mean? Inside an HTML tag
------ Solution ----------------------------------- ---------
/ / display a layer of the mouse , the contents of the layer is div1 content
function showTip (e, content, ifhave) {
/ / if (e!) e = window.event;
/ / alert (e);
if (ifhave == null | | ifhave == '0 ') return;
/ / var div1 = document.getElementById ('divdisplay'); / / will be ejected layer
/ / div1.innerHTML = " Note :" + content;
var div1 = document.getElementById (content); / / will be ejected layer
var x, x1;
var y, y1;
if (window.event) {
e = window.event;
x = (e.clientX + document.body.scrollLeft +10); / / mouse position in the X -axis current , plus 10 is easy to move 10 px to the right to see the contents
y = (e.clientY + document.body.scrollTop +6);
/ / if ((x +400)> document.body.clientWidth) {x = x-400;}
if ((y +150)> document.body.clientHeight) {y = y-150-6;}
} else {
x = (e.pageX +10); / / mouse position in the X -axis current , plus 10 is easy to move 10 px to the right to see the contents
y = (e.pageY +6);
/ / if ((x +400)> document.body.clientWidth) {x = x-400;}
if ((y +150)> document.body.clientHeight) {y = y-150-6;}
}
div1.style.left = x + "px"; / / mouse position in the X -axis current , plus 10 is easy to move 10 px to the right to see the contents
div1.style.top = y + "px";
div1.style.display = "block"; / / div1 initial state is invisible to visible setting
/ / window.event event state representatives , such as the elements of the incident , keyboard state , mouse position and mouse button state .
/ / clientX mouse pointer position relative to the x coordinate of the window 's client area , which does not include the client area of ​​the window itself and scroll bars .
div1.style.position = "absolute"; / / must specify this attribute , otherwise div1 layer can not move with the mouse
}

/ / close layer display div1
function closeTip (event, divid)
{
/ / var div1 = document.getElementById ('divdisplay');
/ / div1.style.display = "none";
document.getElementById (divid) style.display = "none".;
}
------ Solution --------------------------------- -----------
image alt attribute labels can have text prompts . On what label you want to use ?
or use jquery
------ Solution --------------------------------- -----------
prompt box with no complicated alt = " enough ah. "
------ Solution -------------------------------------- ------
add an alt attribute
------ Solution --------------------------- -----------------

onmousemove Event  Internet Development Index 

--------------------------------------------------------------------------------

Fires when the user moves the mouse over the object. 



------ Solution ----------------- ---------------------------
If the swing, there is a setToolTipText method
------ Solution - ------------------------------------------

ding
------ For reference only -------------------------------------- -
is hover over a text , it will pop up a message box is displayed , a message box will detail some of the content , the message box to display a long stay , such as the mouse away automatic message , ask how to achieve this ?
------ For reference only -------------------------------------- -
alt = " your content "
------ For reference only ------------------------- --------------

Upstairs there are no written pro html , ah, how to say a bunch of suit with alt, Alt attribute is provided to illustrate the picture , there are two functions , the first one is when the image can not be displayed when a particular reason the image area will be replaced with the text Alt ; another feature is the alt tag to help search engines identify the pictures, the search engine to determine the content of the picture is the Alt -oriented manner .
The title attribute is used to hover tips ! And generally the most common is for a link tag ~ ~
------ For reference only ------------------------- --------------



The main floor is the effect of it .. I am also looking for , because not learn JS, being tangled ....
------ For reference only ------ ---------------------------------
title really useful

没有评论:

发表评论