Removing Focus Rect 
Author Message
 Removing Focus Rect

Hi

IE5.5+ has <element hidefocus=true>
For others just focus on the window....
onclick="myFucntion();window.focus()"

--
Best Regards
  Vidar Petursson
 ==============================
Microsoft Internet Client & Controls MVP
 ==============================
  http://www.*-*-*.com/


 ==============================
  No matter where you go there you are
 ==============================

Quote:
> Hello,

> I have a JavaScript program with a button. The button uses
> "onmouseover" and "onmouseout". The problem is when I click
> the button a "focus" rect appears around the button (see attached
> screen shot). I tried setting border="0", but that did not help.

> How do I eliminate the focus rect when the button is clicked?

> Attachment(1)

> TIA,
> Jacques



Sat, 19 Feb 2005 17:04:09 GMT  
 Removing Focus Rect
Hi Vidar,

Thank you for responding to my posting.
However, I tried your suggestion and did not
have any affect. I know the function is being
called, because I placed an "alert" method in
the function and the alert box was displayed.

function killFocusRect()
{
  window.focus();

Quote:
}

<a href="./geninfo.htm" target="FRB" language="JavaScript"
onclick="killFocusRect()">
</a>

Any ideas?

Thanks again,
Jacques



Sat, 19 Feb 2005 22:48:03 GMT  
 Removing Focus Rect
This is how I solved a similar problem (took me a while to get it right):

    <script ... >
        IE4 = ((navigator.appName == "Microsoft Internet Ex... // you know
        function deFocus(objct) { if (IE4) { objct.blur(); }}
    </script>

    [...]

    <a href=# onClick=deFocus(this) ...><img src=test.gif ...></a>

I stripped out the unimportant parts for clarity.

Best regards
Tomas Eklund, Sweden



Sun, 20 Feb 2005 01:36:42 GMT  
 Removing Focus Rect
Perhaps I should provide a working example instead... ;-)

    <html>
    <head>
        <script language="Javascript">
            <!--
            function deFocus(objct) { objct.blur(); }
            //-->
        </script>
    </head>

    <body>
        <p>Click the links and see what happens</p>
        <p><a href=#>This will not defocus</a></p>
        <p><a href=# onclick=deFocus(this)>However, this will</a></p>
    </body>
    </html>

Best regards
Tomas Eklund, Sweden



Wed, 23 Feb 2005 01:30:34 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Hiding focus rect?

2. How can I remove the focus boarder on images

3. first rect is green

4. ooops! Focus wont Focus Again

5. Focus Will Not Focus

6. Setting focus to another frame keeps returning focus to the calling routine

7. setting focus and getting focus on menu item

8. remove method for options not removing selected option.

9. moving from C++ to JScript -> how to piece together equivilent of RECT

10. getting focus back to the same text box

11. focus on a text box

12. tab focus

 

 
Powered by phpBB® Forum Software