Copy codeThe Code is as follows:
<Script>
Var index = 0; // It is displayed when you click the mouse for the first time. If you click the mouse again, the layer is not displayed.
/**
* Mouse click event
* BizData: passed Parameter
*/
Function search (bizData)
{
If (index = 0)
{
If (bizData = null) // when the parameter is null, the content of this layer is cleared so that null is not displayed.
{
$ ("BizDiv"). innerText = "";
$ ("BizDiv"). style. background = '# 99ffff ';
Document. onclick = mouseMove;
Index ++;
} Else
{
$ ("BizDiv"). innerText = bizData;
$ ("BizDiv"). style. background = '# 99ffff'; // set the color of the relative page
Document. onclick = mouseMove; // click to trigger the event.
Index ++;
}
} Else {// second mouse click
$ ("BizDiv"). innerText = "";
Document. onclick = mouseMove;
$ ("BizDiv"). style. background = 'transparent'; // set the background color of the layer to "transparent"
Index = 0;
}
}
/*
* Move the cursor over the event to obtain the top and right positions of the layer.
*/
Function mouseMove (ev)
{
Ev = ev | window. event;
Var mousePos = mouseCoords (ev );
$ ("BizDiv"). style. right = document. body. clientWidth-mousePos.x + 15;
$ ("BizDiv"). style. top = document. body. clientHeight-200;
$ ("BizDiv"). style. width = '000000 ';
// $ ("BizDiv"). style. hight = '2013 ';
}
/*
* Get the cursor position
*/
Function mouseCoords (ev)
{
If (ev. pageX | ev. pageY ){
Return {x: ev. pageX, y: ev. pageY };
}
Return {
X: ev. clientX + document. body. scrollLeft-document. body. clientLeft,
Y: ev. clientY + document. body. scrollTop-document. body. clientTop
};
}
</Script>