Giri
Giri

Reputation: 4909

Bootstrap javascript scroll issue

Please check my jsfiddle.

Here is the full screen view..

http://jsfiddle.net/zKhwe/embedded/result/

Please click add more link until you reach the bottom of the page. Then click select a name link. A modal will appear. Just select any name and it will fill the text field.

My problem is after filling the text field, the page scrolled to top automatically.

Can anyone help me to fix this issue?

Here is my source code http://jsfiddle.net/zKhwe/

Upvotes: 2

Views: 130

Answers (1)

Kelvin
Kelvin

Reputation: 5287

Use event.preventDefault() in your click handlers - the page scrolls to the top because you're navigating to # when your links are clicked.

Fixed fiddle: http://jsfiddle.net/zKhwe/1/

Upvotes: 2

Related Questions