开发者

dijit.Menu to be displayed after DOM had been set up

开发者 https://www.devze.com 2023-01-22 16:28 出处:网络
I have set up in Javascript my preferred dijit.Menu which is that far so good. How am I able to display the dijit.Menu directly after the page starts up in the(with it\'s position) without any mouse

I have set up in Javascript my preferred dijit.Menu which is that far so good.

How am I able to display the dijit.Menu directly after the page starts up in the (with it's position) without any mouse interaction?! I have looked in the API so far and don't find the answers. Will I have to "overwrite" a method?

If yes, wh开发者_运维百科ich one is it? And what do I have todo???


The widget will not show up until it is parsed by dojo.
You should place fake menu markup inside its dom node:

<div dojoType="dijit.Menu">
   <h1>This text is shown after the dom is loaded 
       and until the menu is parsed and renered</h1>
</div>

As soon as menu is ready, everything you've placed inside menu's dom node will be replaced by actual widget's html.


NON-AMD Version:

dojo.ready(function(){
// The code for all items!
})

DOJO-AMD Version, put the parameters of the modules you like to add, in require as well give them a name in the functions parameters list:

require(["dojo/domReady!"],function(){
//natve code
});
0

精彩评论

暂无评论...
验证码 换一张
取 消