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 ?

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

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".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.