views:

376

answers:

3

I want to wipe in with object that define style with display: none;:

dojo.fx.wipeIn({
node: dojo.byId("target"),
duration: 500
}).play();

but the animation could not play. what is problem?

i use this for showing the display properties but still showing nothing. The alert message is empty.

    dojo.fx.wipeIn({
  node: dojo.byId("target"),
  duration: 500,
  beforeBegin: function(){
   alert(dojo.byId("target").style.display);
  },
  onEnd: function() {
   alert(dojo.byId("target").style.display);
  }
 }).play();
A: 

This is working for me with a very simple page:

<html>
<head>
    <title>wipeIn test</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js"&gt;&lt;/script&gt;
    <script type="text/javascript">
        dojo.require("dojo.fx");

        dojo.addOnLoad(function() { 
    dojo.fx.wipeIn({node: 'target', duration: 500}).play();
        });
    </script>
</head>
    <body>
        <div id="target" style="display:none; background-color: #444; color: #fff; height: 400px; width:300px;">
            <br />Unnecessary animation :-)
        </div>
    </body>
</html>

Can you post more of the code you're using?

Swingley
A: 

check this :

<html>
<head>
    <title>wipeIn test</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js"&gt;&lt;/script&gt;
    <script type="text/javascript">
        dojo.require("dojo.fx");

        dojo.addOnLoad(function() { 
       dojo.fx.wipeIn({node: 'target', duration: 500}).play();
        });
    </script>
    <style>
     #target {
      display:none; background-color: #444; color: #fff; height: 400px; width:300px;
     }
    </style>
</head>
    <body>
        <div id="target">
            <br />Unnecessary animation :-)
        </div>
    </body>
</html>

when use display: none; in stylesheet the dojo faild.

This looks to be a bug in dojo.fx.wipeIn as moving the style declaration inline fixes the problem.
seth