Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Change css :onhover distance

Change css :onhover distance

Problem

I was wondering if there was a way to make css :onhover occur sooner (i.e. I'm 10px away from a link, and :onhover calls, while still 10px away).

Edit: I'm trying to figure out a way to change the :onhover distance for a scrollbar.

Edit 2: Here's the code:

html {
    overflow: auto;
}
body {
    position: absolute;
    top: 20px;
    left: 20px;
    bottom: 20px;
    right: 20px;
    padding: 30px; 
    overflow-y: scroll;
    overflow-x: hidden;
}
::-webkit-scrollbar {
    width: 5px;
}

/* Track */
::-webkit-scrollbar-track {
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: none;
}

/* Handle */
::-webkit-scrollbar-thumb{
    -webkit-border-radius: 10px;
    border-radius: 10px;
    background: rgba(200,200,200,0.1);
}
::-webkit-scrollbar-thumb:hover {
    -webkit-border-radius: 10px;
    border-radius: 10px;
    background: rgba(200,200,200,0.8); 
}
Problem courtesy of: CharlesL

Solution

Add CSS border property to the element which then will receive the hover event.

Reference 1: jsFiddle Proximity Detector

Edit: I now see you've re-written a major edit to your Question.

I've looked at your code and have come up with a method that you might like for Chrome's scrollbar!

Reference 2: jsFiddle Scrollbar Proximity Detector

Solution courtesy of: arttronics

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Change css :onhover distance

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×