fadeIn not working


  • Using this code:

        div = document.createElement("div");
        return Fragments.render("/html/fragments/error_warning_bar.html", div, event).then(function(element) {
          var close, closeButton, p, solution, solutionButton;
          p = element.querySelector("p");
          if (p != null) p.innerText = event.text;
          close = function() {
            return element.parentElement.removeChild(element);
          closeButton = element.querySelector(".app-error-close");
          if (closeButton != null) closeButton.onclick = close;
          solution = event.detail.solution;
          solutionButton = element.querySelector(".app-error-solution");
          if (solutionButton != null) {
            solutionButton.onclick = function(event) {
              try {
                return close();
              } catch (error) {
                return log.error("Could not execute solution for error " + event.text, error);
          return null;

    the error bar is always visible instantly instead of being faded in. What's the correct use of fadeIn?

    Friday, March 30, 2012 2:58 AM

All replies

  • Is the div you create initially not visible?

    Jeff Sanders (MSFT)

    Friday, March 30, 2012 12:35 PM
  • it is created visible. Actually, has no styles attached.
    Friday, March 30, 2012 1:22 PM
  • Does the animation sample work for you?  Are you applying the same properties to your HTML?


    You have to set the opacity.  There are a two ways to do this, one is by the containing element or you can do individual elements.

    If you are doing the same thing and the sample works but your code does not, perhaps you can post a simple repro here.


    Jeff Sanders (MSFT)

    Friday, March 30, 2012 1:28 PM
  • Jeff, its not only the fadeIn that is not working, fadeOut is also not working, as well as showPanel

    WinJS.UI.Animation.showPanel(element, {
            top: "120px",
            left: "0px"

    Friday, March 30, 2012 2:04 PM
  • OK I will see if the sample fails for me too here.

    Thanks for reporting this Phil.


    Jeff Sanders (MSFT)

    Friday, March 30, 2012 2:08 PM