2

I have a ul list of 100+ li elements displayed inside dojo.contentPane which is displayed in a custom dialog which extends dojo dialog. When this contentPane is rendered, I would like scroll bar to automatically slide to nth li element. How can I do that?

I have seen an example at: http://jsfiddle.net/6aNrp/ where scrolling happens on click of a button, but I would like the same behaviour automatically during rendering.

4

1 回答 1

1

将您的代码放在内容窗格的 onLoad 事件中:

dojo.connect(dijit.byId("myContentPane"), "onLoad", function(evt){
    // your code here
});
于 2011-11-24T09:48:14.960 回答