vvv
vvv

Reputation: 31

How do you add a scrollbar for paging in PHP?

I have a lot of images stored in database, and want to display those images on the page, three per row.

I'd like to use a scrollbar for listing those images instead of paging through them. So instead of Next/Previous buttons, I'd like to use a scroll bar to display the images ...

Upvotes: 3

Views: 1013

Answers (4)

Ali Aboussebaba
Ali Aboussebaba

Reputation: 1162

You need to use Ajax, and jQuery may simplify your life, check this awesome tutorial, it may solve your problem: http://www.bewebdeveloper.com/tutorial-about-ajax-scroll-paging-using-jquery-php-and-mysql

Upvotes: 1

Lance Roberts
Lance Roberts

Reputation: 22842

One link to look at is here, and here, but it'd probably be easier to do this in CSS.

Upvotes: 0

TheRealTy
TheRealTy

Reputation: 2429

You need to set the div height for the div that will hold all the images, then set overflow-y: scroll;

Upvotes: 1

djlumley
djlumley

Reputation: 2967

Your question is unclear.

If you want to display all the images, get them all from the database and print the HTML for each one. If you want to do rows, use the mod http://php.net/manual/en/internals2.opcodes.mod.php operator and a count variable to determine how many images you've counted through and whether or not you need a new row (to get the 3 images per row)

Upvotes: 0

Related Questions