Jump to content

Image Links from db


Xtremer360

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.