1internet Posted January 24, 2013 Share Posted January 24, 2013 I have a search results page, and when someone clicks on the next link, or a higher page number, I want the current results to slide out to the left, whilst the new ones slide in from the right. Then if someone clicks on previous or a lower page number I want the current results to slide out to the right, and the new ones to slide in from the left. Also if possible can it change the url when the new results come in? I want to use jquery, and was wondering what is the best way to do this, would it be using animate? I have tried but cant seem to work it out. Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/ Share on other sites More sharing options...
codefossa Posted January 24, 2013 Share Posted January 24, 2013 With jQuery, you would use Ajax and get the page loaded, put the return content in a DIV and use CSS to position it off the screen. Then just use $.animate() and move them to their locations. After moving it, you may want to actually put the content there (remove the style for location) so it doesn't pop out of it's place when someone resizes the browser. Remember to remove the old data or you'll end up with a huge amount of data depending on what you're going through. Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/#findComment-1407988 Share on other sites More sharing options...
1internet Posted January 24, 2013 Author Share Posted January 24, 2013 Can the url be updated too? Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/#findComment-1407994 Share on other sites More sharing options...
codefossa Posted January 24, 2013 Share Posted January 24, 2013 You don't change the URL like that. If you could, phishing sites would be quite a bit scarier than they are now. lol If you want the URL to change, you would have to reload the page. Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/#findComment-1408012 Share on other sites More sharing options...
1internet Posted January 26, 2013 Author Share Posted January 26, 2013 That's not true, you can change the url without reloading, but I am not sure how it is done. Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/#findComment-1408329 Share on other sites More sharing options...
trq Posted January 26, 2013 Share Posted January 26, 2013 That's not true, you can change the url without reloading, but I am not sure how it is done. Indeed you can change the url. You do so with the history object's pushState() method. Google it. Also, check out the fantastic library history.js https://github.com/balupton/History.js Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/#findComment-1408332 Share on other sites More sharing options...
codefossa Posted January 26, 2013 Share Posted January 26, 2013 First thing that came to mind is he wanted to change the domain, though I've never used that. Interesting .. And would that add to the history, allowing you to go back through cached versions of the page? Quote Link to comment https://forums.phpfreaks.com/topic/273593-old-results-sliding-out-new-ones-sliding-in/#findComment-1408383 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.