Go Back   CodingForums.com > :: Client side development > JavaScript programming > Post a JavaScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-11-2003, 04:56 PM   PM User | #1
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
a onfocus element.blur behavior

i'm sure its been thought of before and i'm sure this is just gunna piss off the people who like to tab through their pages, but i just made a little behavior component file that stops any links from gaining focus on your page.

put this is the style section of your page.

Code:
<style type="text/css">
a { behavior: url("hidefocus.htc"); }
</style>
then put the attached file in the same dir. (hidefocus.htc) this is all it is

Code:
<public:component>
<public:attach event="onfocus" handler="blurry" />

<script>
function blurry() {
      element.blur();
   }
   
</script>
</public:component>
Note: since this behavior is stored in an external file, sometimes one instance of link focus can occur before the htc file can be loaded. if anyone has any tips on fixing that i'd like to hear'em.
Attached Files
File Type: zip hidefocus.zip (440 Bytes, 289 views)
Shecky is offline   Reply With Quote
Old 03-11-2003, 05:33 PM   PM User | #2
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Re: a onfocus element.blur behavior

Quote:
Originally posted by Shecky
if anyone has any tips on fixing that i'd like to hear'em.


My tip would be don't use it at all. If you want to hide the focus-border you must only ever do it with click or mousedown/up events; never with focus.

Sorry - my anger is not directed at you or anyone specifically - but I get annoyed by this kind of anti-accessibility scripting; it's the exact opposite of the kind of coding practise I'm trying to encourage. This would be infinitely better:

<public:attach event="onmousedown" handler="blurry" />
<public:attach event="onmouseup" handler="blurry" />

Unplug your mouse. Try working without it. Then you'll see.
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

Last edited by brothercake; 03-11-2003 at 05:38 PM..
brothercake is offline   Reply With Quote
Old 03-11-2003, 06:25 PM   PM User | #3
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
a mouse abused you as a child, didnt it?

WOAH...

oh brothercake, how many coding jams have you helped me out of? ...and now this... THIS!!! Are you from a country where mice are considered sacred and you can't touch them?

I'm not sure about you anti-mouse people... it was created for a reason you know. The mouse wheel, especially! For what reason do you feel the tab button is more functional than a wheel and a pointer?

Everyone and their mother tabs through forms, this type of thing which requires one to type... i'm sorry if you're one of the few who has to tab through EVERY page, and who winces when your fingers have to leave the home row

To be fair i also didnt take into consideration anyone who uses a browser other than IE, so there ya go. Broad based discrimination. (That probably didnt help my case.)

I don't believe i'll be unplugging my mouse unless i feel like roughing it for a few days.. eh, or... maybe... it is lent and all. Now if someone starts messing with my onmousewheel function, then theres hell!!!!!!!!!!

btw, onmousedown and onmouseup are too slow from a timing standpoint to totally eliminate the ugly outline. so nah. This is meant for a person who USES onfocus="blur(this)" and doesnt like to type it out for every single link. There are a lot of us, sorry...

and now that i've started some sort of onholy focus war, i shall run off and hide until brothercake and his clan come back and give me what for.

(press [TAB] nine times to go to the submit reply button, please.)
Shecky is offline   Reply With Quote
Old 03-11-2003, 06:52 PM   PM User | #4
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
It's not about what I like ..

Quote:
Originally posted by Shecky
For what reason do you feel the tab button is more functional than a wheel and a pointer?
How about - for people who can't use a mouse ...

My suggestion you unplug your mouse is so you can empathise with those people; understand how they navigate websites so you can allow for this in your coding practise.

Don't get stressed though - I'm not having a go at you. But this is important - hence the strength of my response
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

Last edited by brothercake; 03-11-2003 at 07:03 PM..
brothercake is offline   Reply With Quote
Old 03-11-2003, 07:10 PM   PM User | #5
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
Re: Re: a mouse abused you as a child, didnt it?

Quote:
Originally posted by brothercake
How about - for people who can't use a mouse ...

My suggestion you unplug your mouse is so you can empathise with those people; understand how they navigate websites so you can allow for this in your coding practise.

Don't get stressed though - I'm not having a go at you. But this is important - hence the strength of my response
If you're going to place special consideration on these people, you may as well code all of your web pages with.. i dunno... netscape 2 in mind.

Theres that old saying, you cant please everybody all of the time. To the people who can't use a mouse but for some reason can use a keyboard, i'm very sorry... but only in a symbolic sense.

Short of stephen hawking coming to my door and having his goons beat it out of me, i think i'm gunna stick with eliminating focus on links.
Shecky is offline   Reply With Quote
Old 03-11-2003, 07:58 PM   PM User | #6
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Quote:
Originally posted by Shecky
If you're going to place special consideration on these people, you may as well code all of your web pages with.. i dunno... netscape 2 in mind.
Exactly

Accessibility in no way implies a reduction in functionality; it's all about how you apply that functionality so that it degrades gracefully.

Netscape 2 is an excellent test browser; with an XHTML+CSS paradigm there's no reason why you can't make the eye-candy all-singing all-dancing site you want, that is *still* basically coherent, legible, navigable and useable in the most basic of web browsers, all the way back to Lynx.

Sure it won't look the same, but it doesn't have to; equivalency does not mean equality.

Quote:
Originally posted by Shecky
i'm very sorry... but only in a symbolic sense.
I'm not sure what you mean by this. You don't have to make your site accessible if you don't want to. What I don't understand is why you wouldn't want to; why not make the best possible website you can? Because you don't like dotted lines ..?

Is your website just for you? If it is, then fair enough; forget everything I've said. If not ... well ... accessibility is not just about disabled people; it's about everyone.

I could ramble on forever ...
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

Last edited by brothercake; 03-11-2003 at 08:05 PM..
brothercake is offline   Reply With Quote
Old 03-11-2003, 09:00 PM   PM User | #7
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
Angry

Shecky has issued this official response:

[statement]
to which he would like to add "so bleh on you" and "you smell"
Shecky is offline   Reply With Quote
Old 03-11-2003, 09:12 PM   PM User | #8
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Just skimming through this thread, there are two distinct things at work:

1. You don't like dotted lines
2. You disable focusing

Taking care of #1 does not require performing #2.

Just because focusing causes "ugly" (your opinion) dotted lines doesn't mean you should disable focusing. Rather, why not change the focus indication?

a:focus {
outline: black solid 1px;
}

For a solid outline instead of a dotted one. Use -moz-outline in addition if you want it to work in Moz, as well as Opera and Konqueror.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 03-11-2003, 09:59 PM   PM User | #9
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
Quote:
Originally posted by jkd

Just because focusing causes "ugly" (your opinion) dotted lines doesn't mean you should disable focusing. Rather, why not change the focus indication?

a:focus {
outline: black solid 1px;
}

For a solid outline instead of a dotted one. Use -moz-outline in addition if you want it to work in Moz, as well as Opera and Konqueror.
If someones goal was to not, themselves, see any dotted lines on web pages that they made, then they should take that advice.

I want other people not to see the focus... in my own personal form of focus nazism, or something. Focus is the cause of all of our problems, and it must be eliminated!!!!

As shocked as i am that some browsers now support that outline css style, i dont think i'll be using it for the benefit of only mozilla, opera, and konqueror users.

I'll just make a version that hides the outline, but changes the color when focused that'll please everyone. Unless cake boy finds a problem with that too!
__________________
seldom ruined but by myself
Shecky is offline   Reply With Quote
Old 03-11-2003, 10:20 PM   PM User | #10
WA
Administrator


 
Join Date: Mar 2002
Posts: 2,596
Thanks: 2
Thanked 19 Times in 18 Posts
WA will become famous soon enough
Ok guys, I know this is mostly in fun, but lets lay off the whimsical sarcasm, as it could easily be misunderstood eventually. This thread will remain open as long as any further discussion gets back on "track."
__________________
- George
- JavaScript Kit- JavaScript tutorials and 400+ scripts!
- JavaScript Reference- JavaScript reference you can relate to.
WA is offline   Reply With Quote
Old 03-12-2003, 01:14 AM   PM User | #11
Borgtex
Regular Coder

 
Join Date: Aug 2002
Location: Spain
Posts: 420
Thanks: 0
Thanked 0 Times in 0 Posts
Borgtex is an unknown quantity at this point
my two cents: no dotted lines, no focusing disabled, one single instruction

document.onclick = self.focus;

brothercake, as I agree with you concerning to accessibility, I think that your anger is a bit disproportionate; remember: Flash is the real enemy
__________________
Don't resist to assimilation. Billions of Borgs can't be wrong!
Borgtex is offline   Reply With Quote
Old 03-12-2003, 02:14 AM   PM User | #12
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
Quote:
Originally posted by Borgtex
my two cents: no dotted lines, no focusing disabled, one single instruction

document.onclick = self.focus;

brothercake, as I agree with you concerning to accessibility, I think that your anger is a bit disproportionate; remember: Flash is the real enemy
Well it is awfully simple... if only it fit in with my blurred reich. I even redundantly added the stoptab feature, for extra spite.

Man i hope brothercake will still help me with my coding questions after this. ::waves at BC:: dont be maaaad!
__________________
seldom ruined but by myself

Last edited by Shecky; 03-12-2003 at 12:01 PM..
Shecky is offline   Reply With Quote
Old 03-12-2003, 09:51 AM   PM User | #13
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Quote:
Originally posted by Shecky
::waves and BC:: dont be maaaad!
Course not It's all cool; we're just having a discussion
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark
brothercake is offline   Reply With Quote
Old 03-12-2003, 06:48 PM   PM User | #14
beetle
Senior Coder

 
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
beetle has a little shameless behaviour in the past
Well, since using a DHTML behaviors is only for IE 5.5+, you might as well use another IE 5.5+ only thingie
__________________
My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
“Minds are like parachutes. They don't work unless they are open”
“Maturity is simply knowing when to not be immature”

Last edited by beetle; 03-12-2003 at 06:51 PM..
beetle is offline   Reply With Quote
Old 03-12-2003, 08:55 PM   PM User | #15
Shecky
Regular Coder

 
Join Date: Dec 2002
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Shecky is an unknown quantity at this point
yea i couldnt get hidefocus to work with it ::shrugs::

you'll have to show me up and figure it out for my stupid ***.
__________________
seldom ruined but by myself
Shecky is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:38 PM.


Advertisement
Log in to turn off these ads.