Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Stuck on a CSS Sprite Map

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #162835
    Josh
    Participant

    Hey all, I’m having a hard time figuring out what I’m missing here.

    I’ve tried a number of variations but this thing won’t seem to budge. Basically, someone asked me to help them put together an image of their rooms for a small B & B, so you’ve got the floorplan that the user could hover on and then click.

    So I thought I could just do this with a sprite.

    In playing with it, I can’t seem to get the sprite to actually move based on the hover.

    Here’s the pen that I created to play with it: http://codepen.io/anon/pen/gzdHv

    Does anyone see where I’m messing this up?

    #162879
    Paulie_D
    Member

    so you’ve got the floorplan that the user could hover on and then click.

    Not sure what you are expecting to have happen…it sounds like you want the map to have hover spots which is not how a sprite works.

    #162927
    alston
    Participant

    You can get the background to display different “positions” of an image sprite on link hover.

    For each corresponding link you hover over, give the image (area) displayed the pixel coordinates of the top-left corner of the sprite’s position that then shows the image on the sprite you want visible.

    But at first I thought you meant to have the image itself move based on what part of it you’re hovering over, am I confused in your question?

    #162958
    Paulie_D
    Member

    I thought it would be cleaner if I could just get the background image to change positions based on which link you’re hovering over.

    You can…kind of: http://codepen.io/Paulie-D/pen/jHpzi

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.