Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    :hover state in certain area of the image.

    I have been working with a lot of large area images lately, that are in essence split into different areas. Let's take for example a square that is split into four different equal squares. Each of these smaller squares has a :hover state similar to any other normal :hover state. The thing is, with some of these more complex images (unlike a square), I am wondering if there is a way to keep the image as one image and designate an area for the hover. For example with the square, to be able to say something like,

    if (the mouse enters area from x = 0, x = 90px && y = 0, y = 90px) { switch to :hover state 1 }

    That obviously wouldn't be the code, but I hope this explanation makes sense. So, is there a way to do this, and if so, could someone direct me to the proper place to figure it out. It would be quite useful. Thanks!

    (Maybe this is possible with canvas?--I know very little about canvas)

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts


  •  

    Posting Permissions

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