Smooth pagination using PHP,MYSQL<AJAX

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aniltc
Forum Newbie
Posts: 17
Joined: Thu Nov 16, 2006 6:42 am

Smooth pagination using PHP,MYSQL<AJAX

Post by aniltc »

hi all

I have a ribbon image (ribbon image means-around 6 small images in a row with previous Button in the beginning and Next button in the end) .What i want to do when i am clicking on a next button I want to display next 6 images with the running effect.Running effect means user should feel all images are going to front without reload the page(using AJAX) and same thing will happen for Previous (when some one clicking on the previous link i need to show previous 6 images with running effect using AJAX.

I hope everyone understood my situation here.


Please help me

Thanks to all
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

what have you tried till now to achieve this.
could you describe the process in pseudo code.
aniltc
Forum Newbie
Posts: 17
Joined: Thu Nov 16, 2006 6:42 am

Post by aniltc »

hi

I just tried to display the images in a row .now i am trying to do previous and next button links.That part is ok.But
i have no idea how to give the ajax based effects when some one clicks on the links.this is where i got stuck


please help me

Thanks
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

Have a look at Prototype

You could use something like

Code: Select all

<script language="Javascript">
function Request(page)
{
	var d = new Date();
	var time = d.getTime();
    $('inhoud').innerHTML = '<div id=loading>Loading images, please stand by...</div>';
    new Ajax.Updater('images',page+'?&time='+time,{asynchronous:true, method: 'get'});
}
</script>
With a div id=images with get data to retrieve the correct images.
You'll have to include the prototype.js file too

//edit, what's the bbcode to display javascript with all its fancy colors?
aniltc
Forum Newbie
Posts: 17
Joined: Thu Nov 16, 2006 6:42 am

Post by aniltc »

Thanks

can i use prototype for ajax effects.I am able to do the ajax fuctions without using prototype library.What i am looking for when a user clicks on next button or next link the user should feel all images are going back and gettiing next messages


Is this possible with prototpe?

please help me

Thanks to all
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

You can build dhmtl effects with prototype.js, sure. If you don't fancy coding your own then script.aculo.us is an effects (and more) library built on top of Prototype.js. Alternatively to that there's JQuery, which is another Ajax library that does include effects by default, though fewer than script.aculo.us.

I've used all three, and built an application with script.aculo.us and Prototype.js. If I was just starting out though I think I'd use JQuery. It's lovely, and very lightweight.
aniltc
Forum Newbie
Posts: 17
Joined: Thu Nov 16, 2006 6:42 am

Post by aniltc »

Thanks
Post Reply