Xtremer360 Posted September 2, 2011 Share Posted September 2, 2011 With my custom CMS I'm developing I have a menu structures type module where the admin can create a menu structures for their website. Inside the db is the links table and I'm trying to figure out what I can do if the link has an actual image. I created a field called link_image however I just thought of what if the link is apart of a sprite which would have most of the time 3 parts of the image (active, hover, normal) or whatever or has its own sprite. How should I handle this if I want to store this information in the database. Link to comment https://forums.phpfreaks.com/topic/246304-image-links-from-db/ Share on other sites More sharing options...
requinix Posted September 2, 2011 Share Posted September 2, 2011 Ask if the image is a sprite and, if so, whether it's horizontal or vertical. If the former then the sprite is 1/3rd the width of the image, and if the latter then the sprite is 1/3rd the height of the image. Use background-position (or whatever) to move around the image's viewport by that amount. Link to comment https://forums.phpfreaks.com/topic/246304-image-links-from-db/#findComment-1264946 Share on other sites More sharing options...
Xtremer360 Posted September 2, 2011 Author Share Posted September 2, 2011 Thank you. Good input. Link to comment https://forums.phpfreaks.com/topic/246304-image-links-from-db/#findComment-1264947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.