PDA

View Full Version : sprite navigation


BullDog
03-05-2013, 08:45 AM
I thought I had this working correctly. the math is correct for the button location but although it works correctly in DW it the rollover is displaying incorrectly. Any pointers/help would be greatly appreciated.

http://www.norcalaircooledgroup.org/matt2/mpr/

BullDog
03-05-2013, 10:19 AM
I've also pushed the fans background to the bottom of a 100% height div, but cant seem to get the footer to the bottom on top of it now.

Thank you

BullDog
03-05-2013, 11:39 AM
please disregard the footer issue. not the way I wanted to handle it but it will work. the navigation however is still baffling me.

BullDog
03-05-2013, 12:26 PM
I managed to get this working by changing from:

#nav-home { width: 78px; }
#nav-home a:hover{ background-position: bottom -29; }

to

#nav-home { width: 78px; }
#nav-home a:hover{ background-position: -29px bottom; }

Now I would swear This used to work as I pulled this from a video tutorial.

I would still be very interested to hear if I found the correct error/fix or if there is another issue I'm missing.

gentleone
03-05-2013, 02:16 PM
All I can say is that why do you take 'bottom' as referrer to get the right coordinates of your sprites buttons. I know it works, but it's a bit awkward to me.

The default value of background-position is 0 0 which is top left, thus the default background position is the top left corner of the image. If I have to get my coordinates in a sprite then that's my starting point to do the math.

BullDog
03-05-2013, 04:10 PM
Thats just the way I learned from a couple tutorials. have only done it a couple times before.

If I change that "bottom" to "-32" it doesnt work correctly

gentleone
03-12-2013, 09:11 AM
If I change that "bottom" to "-32" it doesnt work correctly
-32 doesn't do anything indeed. -32px does.

BullDog
03-12-2013, 11:14 AM
Thank you... always seems to be the obvious, just cant always see it when you've been looking at it for hours.