Kind of an ajax slider
Imagine you click on Categories and go to a page like "news.php?category=2". In that page it'll show the news of the category and it has two buttons, "Previous category" and "Next category", the href for these buttons are "news.php?category=1" and "news.php?category=3", respectively.
I've used jQuery .load() to load from Categories to the News page and it worked perfectly.
$('.newstrigger').click(function() {
var toLoad = $(this).attr('href')+' #container';
$('#wrapper').append('<div id="lastcontainer"></div>');
$('#lastcontainer').load(toLoad);
return false;
});
The problem is I can't seem to load the same page again with different parameters.
Can you guys help me?
After the load, I want to animate the content to the left (or right, depending which button the user has clicked) and make the loaded content appear from the right. That's why the title of this question has slider on it. No problems with this part of the code, I suppose.
UPDATE: I'm currently working on it here: Link This version doesn't have PHP, but you can see what I'm after. Click on "Projectos" a开发者_开发技巧nd than on "Categoria 1".
It would really help to see the rest of your code. it seems to me if you click twice you will have 2 divs with id=lastcontainer
also, i don't understand -- does this work once but not twice or not at all?
精彩评论