Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

links disabled in NN with event capture

Status
Not open for further replies.

wduty

Programmer
Jun 24, 2000
271
US
I'm writing a DHTML-based scroller which allows the user to click on buttons which scroll some text content up or down. Works fine in IE and Netscape. However, in Netscape, the <i>document.captureEvents</i> has the unforunate side-effect of disabling all other links (Without checking for a click location and writing redirect functions). Anyone ever dealt with this problem? Any suggestions appreciated.<br><br>the script is too long to place in this page but I have it up at the following location so you can see it and look a the source there:<br><br><A HREF=" TARGET="_new"> <p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br>
 
Actually, I figured out a simple way to solve this problem. For anyone curious: <br><br>set up two global variables:<br><br><font color=red>toggleLink</font>: a boolean which is set to true in a <i>onMouseover</i> of every link in the page. It is set to false in an <i>onMouseout</i> of every link the page.<br><font color=red>target</font>: a string which is the target url of the link. This value is set to the url of each link in the same onMouseover in each link described above.<br><br>Therefore when the user moves the mouse around over links the the switchToLinks variable becomes a flag that a link is being hovered over. Then in the target of the event capture for mousedown, place an if statement which redirects the page if the switchToLink variable is true. Thus all the links in the page look like this:<br><br>&lt;a href=&quot;<A HREF=" TARGET="_new"> name=test onMouseover=&quot;switchToLink=true;&nbsp;&nbsp;currentLink='<A HREF=" TARGET="_new"> onMouseout=&quot;switchToLink=false;&quot; onMousedown=&quot;location='<A HREF=" TARGET="_new"> the function which is the target of the document.captureEvents would look like this:<br><br>function movePage(evt)<br> {<br> window.status = switchToLink<br> if (N && switchToLink) location=currentLink;<br> if (!toggle)<br> {<br> toggle = true;<br> if (M)...<br><br>Works great. However, I would still appreciate any comments if anyone else has found other solutions to this kind of problem. <p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top