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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE image buttons WITHOUT a focus?

Status
Not open for further replies.

hoolz

IS-IT--Management
Dec 5, 2000
17
0
0
US
hello all,

i read on this forum a while back that someone knew how to create a function or a style that made it to where you don't get those annoying halos around buttom images in IE 5 and lower. i really need to know how to take care of this, so if anyone knows how, please help!

thanks in advance!

hurry up and wait!

aim screenname: phentalmyst

:D
 
this will work on all links:

function linkFocusFix()
{
var i,dlinks,dlinklen;
dlinks = document.links;
dlinklen = dlinks.length;
for(i=0;i<dlinklen;i++)
{
dlinks.onfocus=function (){this.blur()}
}
}
linkFocusFix()

for image buttons I suggest using the traditional:

<input type=&quot;image&quot; onfocus=&quot;this.blur()&quot;>

jared@aauser.com
 
jaredn - how come whenever I try to redefine an event handler in the usual way it doesn't work? You know without using a new function - just calling a handle function? What's up with that? BB &quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
check out my faq in the javascript forum. it has to do with function references as opposed to function calls. jared@aauser.com
 
That's not what I mean - I mean calling... wait I see that code loops thru the elements.

I was trying to redefine the event for a particular 'genus' if you will - so instead of redefining document.onclick - redefine 'every element of a type''s onclick? So every link will auto have the redefined event handler.

this can be done using the new function call, but I wondered why it didn't work jus calling the reference?




&quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
That's not what I mean - I mean calling... wait I see that code loops thru the elements.

I was trying to redefine the event for a particular 'genus' if you will - so instead of redefining document.onclick - redefine 'every element of a type''s onclick? So every link will auto have the redefined event handler.

I guess you still have to loop thru all the elements anyway.




&quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top