SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot simplyunique's Avatar
    Join Date
    Jun 2003
    Location
    Montreal
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    this.blur on image links to fix dotted lines

    http://www.htmlgoodies.com/beyond/nodottedline.html

    Code:
     <A HREF="http://www.whateversite.com" onClick="this.blur()">
    <img src="anyimg.jpg"></a>


    Is there any way to apply this site-wide without the need for insertion into every image link?
    Fonkuscious say: Sink a foot in into my code and stub your toe

  2. #2
    SitePoint Addict
    Join Date
    Dec 2002
    Posts
    386
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There probably is, try looking at the recent sitepoint article on opening new windows in a standards way...

    However... that little dotted line is there for a very good reason and you would be messing wirth accessibility and usability if you get shot of it

  3. #3
    SitePoint Zealot simplyunique's Avatar
    Join Date
    Jun 2003
    Location
    Montreal
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would I add this to CSS a:link ? Do you think thats possible? to css the blur ?
    Fonkuscious say: Sink a foot in into my code and stub your toe

  4. #4
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could add this:

    Code:
    window.onload = function()
    {
    	links = document.getElementsByTagName('a');
    	numLinks = links.length;
    	for (i=0; i < numLinks; i++)
    	{
    		 currentLink = links[i];
    		 currentLink.onclick = function()
    		 {
    			  this.blur();
    		 };
    	}
    };
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  5. #5
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this should do that:
    Code:
    window.onload = function()
    {
    	elements = document.getElementsByTagName('*');
    	numElements = elements.length;
    	for (i=0; i < numElements; i++)
    	{
    		currentElement = elements[i];
    		if (currentElement.tagName=='A' || currentElement.tagName=='INPUT')
    		{
    			currentElement.onclick = function()
    			{
    				this.blur();
    			};
    		}
    	}
    };
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  6. #6
    SitePoint Zealot simplyunique's Avatar
    Join Date
    Jun 2003
    Location
    Montreal
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Jeff,

    I haven't tried this yet. I wonder, can I apply this to select boxes alo somehow?

    I have choice drop downs in an iframe which are doing hall of mirrors on me when i scroll the page. Opera fixes it but ie is borked. It only displays properly again after blur.

    Maybe telling it to blur this way on page scroll or on down arrow/mouse-up(anywhere)
    Fonkuscious say: Sink a foot in into my code and stub your toe


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •