Search code examples
jqueryhtmlmove

Move div block to another position


I have an div block which contains text. In the index page it is too close to the middle, in other page it is too close to the top. I want to make it move, so you start on index page, and when you chose one of the other pages (for example the gallery), the block for the second must be in same place as in the index page, and then start moving to top. To jump from other pages to the index page it must move to the middle. How can I can make this?


Solution

  • Do you replace the content of the div via e.g. ajax, or do you load the whole page every time? If you replace the content dynamically, you can try to animate the div to move via the callback function. Link gets clicked -> Div loads new content -> New content is ready -> Callback-function moves the div up/down.