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.

ataylor
  • 64,891
  • 24
  • 161
  • 189
Sachin
  • 21
  • 4

1 Answers1

1

Put your code in the onLoad event of your content pane :

dojo.connect(dijit.byId("myContentPane"), "onLoad", function(evt){
    // your code here
});
Philippe
  • 6,703
  • 3
  • 30
  • 50