0

Is there a simple way to add animations to static HTML page navigations? My client didn't want any animations initially, so I used static HTML pages on the site I'm building, now, the site being almost finished he changed his mind. I only need a simple fade effect to one specific div when using page navigation. (link tags)

If he had told me before that he wants animations on the site, I would have used ajax as always, adding the fade effect like this (using jQuery):

$(target).fadeout();
$(target).load(url, function() {
    $(this).fadein();
});

I really don't feel like rewriting the whole site to use ajax, and my client doesn't feel like either to pay a surplus because of this.

5
  • what effect is it you need? what should it do?
    – Sergio
    Commented Jul 3, 2013 at 17:20
  • a simple fade effect to one specific div. Fade out when a navigation link is clicked, load the new page, then fade in. Commented Jul 3, 2013 at 17:20
  • a new div that opens? fades to black? fades to transparency? change colors? can you be more specific?
    – Sergio
    Commented Jul 3, 2013 at 17:21
  • No. The site has a few static HTML pages, basically the same content on all pages, only the container div changes its content. When a user clicks on a link, I'd like to add a fadeOut effect to the div, wait for the new page to load, the fade it in. I know how to do this, but it is really complicated, lots of code, so that's why I'm asking if there's a simple way to do it. Commented Jul 3, 2013 at 17:24
  • 3
    Is it really a big deal to write a common script, and load that script to the top of each page? <script src="mydivfade.js">. If the div always has the same class or id, it should magically work once you write the script once. Am I missing something?
    – Jeff B
    Commented Jul 3, 2013 at 17:35

0

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.