0

I want to use some animation on my links, while preserving the RESTful routes of Rails. This is my code:

Rails:

link_to('My new project', 'projects/17', class => 'animated_link')

jQuery;

$(".animated_link").click(function(){

$(".container_project").slideLeft();
// ajax fetches new content to container_groups

$(".container_groups").slideLeft();

});

In the jQuery I will have a code that slides the container of the link. After this animation I want to change the browser adress line as well. Is this possible ?

jakobk
  • 1,102
  • 1
  • 14
  • 26

1 Answers1

2

On clicking one link, you are trying to do 2 things here:

  1. Fetch some code through AJAX and add it to $(".container_project") and $(".container_groups").
  2. Change URL to 'projects/17', which could mean two things:
    - Either you are making a POST and sending some data to the new Page, or
    - You simply want to change the URL

Yes, what you are asking is possible, but the question is what exactly do you have in mind.
Refine your question as per what exactly is that you want to do.

EDIT:
Here are some links that would get you what you need:

  1. modify-the-url-without-reloading-the-page
  2. how-does-facebook-change-the-url-without-reloading-the-page
  3. how-could-i-change-windows-location-without-reloading-and-hack
  4. changing-the-url-without-reloading-the-page
  5. modify-browser-url-without-refresh-page
Community
  • 1
  • 1
Jatin Ganhotra
  • 6,313
  • 6
  • 44
  • 71
  • Hi, thanks for your comment. I am using the project id, to retrieve all groups that belongs to it, and then place that into .container_groups. I am changing the data on the page, and I want to change the url, but without "refreshing the page". – jakobk Jan 22 '12 at 14:45