Sign in to follow this  
fooman_69

[web] Determining if an ID is within a certain range

Recommended Posts

I have a page with a group of 7 thumbnails at the top. I'm not sure how to determine which 7 thumbnails to display. If the page ID is between 1 and 7, the first 7 thumbnails should display... if the ID is between 8 and 14, the next 7 will display. I'm not sure how to program this dynamically I guess. Any help is greatly appreciated!

Share this post


Link to post
Share on other sites
Quote:
Original post by fooman_69
I have a page with a group of 7 thumbnails at the top.

I'm not sure how to determine which 7 thumbnails to display.
If the page ID is between 1 and 7, the first 7 thumbnails should display... if the ID is between 8 and 14, the next 7 will display.

I'm not sure how to program this dynamically I guess.

Any help is greatly appreciated!



numberToStartAt = floor(ID/7)+1; (the floor function may be inside a namespace in some languages, if you say what language you're using you can get more accurate help)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this