dojo.fx.Toggler

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

dojo.fx.Toggler

Jason A. Griffin
https://dojotoolkit.org/reference-guide/1.10/dojo/fx/Toggler.html

I need to set my div's Visibility Style to Hidden immediately after the .Hide() animation completes, otherwise, the animation gets clipped early and portions of the div linger on the screen longer than others.  Fortunately, I can set the Visibility to Visible before I run the .Show() animation without worrying about timing issues.

I couldn't track down any events using dojo.on so I turned my attention to dojo.Stateful to watch the opacity style value of my div but I couldn't seem to get it reporting the value change.  Now I did see in the documentation that there is a parameter which should be callable in order to pause/resume/status track the animation but I couldn't connect the dots when digging through the objects parameters in my browser's console...

Any help is appreciated, sincerely, Jason.

  require(["dojo/dom-style", "dojo/on", "dojo/dom", "dojo/query", "dojo/fx/Toggler", "dojo/domReady!"], function(domStyle, on, dom, query, Toggler) {
    tocToggler = new Toggler({
      node: "toc",
      showDuration: 500,
      hideDuration: 250
    });
    tocButtonClicked = false;
    on(dom.byId("tocButton"), "click", function(evt) {
      if (tocButtonClicked === false) {
        domStyle.set("toc", "visibility", "visible");
        tocToggler.show();
        tocButtonClicked = true;
      } else {
        tocToggler.hide();
        tocButtonClicked = false;
        domStyle.set("toc", "visibility", "hidden");
      }
    });
    on(query("#toc .titleButton.close"), "click", function(evt) {
      tocToggler.hide();
      tocButtonClicked = false;
      domStyle.set("toc", "visibility", "hidden");
    });
  });

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...