2

Every time I click my button at the bottom to open the jquery dialog box, the page will automatically scroll to the top. I'm using firefox browser.

Please advise.

Many thanks.

domlao
  • 15,663
  • 34
  • 95
  • 134

1 Answers1

5

I guess you have to prevent the default operation of the button

$('#myButton').click(function(event){
    event.preventDefault()
    // .... open dialog.
});

OR you have to return false on the onclick event of button

<input type="button" value="My Button" onclick="openDialog();return false;" />
Talha Ahmed Khan
  • 15,043
  • 10
  • 42
  • 49