Javascript Tooltips, Popups, Captions - BoxOver  

Go Back   Javascript Tooltips, Popups, Captions - BoxOver > BoxOver > Suggestions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2007, 09:38 PM
waveform waveform is offline
Junior Member
 
Join Date: Apr 2007
Posts: 3
Default Here's another one... "clickoff=[on]"

This is very useful when using BoxOver on input fields. Forget "?" marks next to form fields, use the field itself.

The one thing I needed for this was way to stop the box from appearing when the user mouses over the form field if they are going to type something or use a dropdown, etc.

Enter the "clickoff" parameter. As soon as the user clicks on the form field, the box is prevented from appearing (if there's a delay) or turned off if it's already on. Combined with a short delay, using clickoff means advanced users never need to see the tooltip, yet novice users can hover to see it. As soon as they click in the field, it goes away.

Changes are easy. First, replace the following block of code in function scanBO(curNode) with this:
Code:
if (getParam('requireclick',curNode.title)=='on') { curNode.requireclick=true; document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false); document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false); } else // Note : if requireclick is on the stop clicks are ignored { if (getParam('clickoff',curNode.title)=='on') { //[AH] enable the clickoff function. document.all?curNode.attachEvent('onmousedown',clickOff):curNode.addEventListener('mousedown',clickOff,false); } else //[AH] If clickOff is on the stop clicks are ignored also. { if (getParam('doubleclickstop',curNode.title)!='off') { document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false); } if (getParam('singleclickstop',curNode.title)=='on') { document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false); } } }
The only other change is to add the clickOff(e) function anywhere you like:
Code:
//[AH] stop box from appearing if there's a delay, and/or turn it off. function clickOff(e) { if(ID!=null) { clearTimeout(ID); ID=null; } hideBox(e); }
That's it. Now you can put "clickoff=[on]" in your parameter list to use it.

Last edited by waveform : 04-04-2007 at 10:59 PM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:48 AM.