0

I have a

<a onclick="document.getElementById('massage').style.display = 'block';">Button</a>

And I want to add a fadeIn to the function, but dont know how.

Charles
  • 50,010
  • 13
  • 100
  • 141
Zoker
  • 1,940
  • 4
  • 29
  • 51

1 Answers1

1

You have two options:

  1. A css3 opacity animation - only suitable for HTML5 enabled browsers i.e. IE9+. Apply this by adding the css class fade to your element.

    .fade { opacity: 1; transition: opacity .25s ease-in-out; -moz-transition: opacity .25s ease-in-out; -webkit-transition: opacity .25s ease-in-out; }

2.) Use jquerys fadein function. Which supports older browsers.

http://api.jquery.com/fadeIn/

You will need to learn jQuery of course if you don't know it but this is worth doing I think.

Hope that helps

Captain John
  • 1,759
  • 2
  • 15
  • 29