Page moving to top when using html()
Hello,
I have to dynamically update some selects which are styled with
Stylish Select 0.4.1. The problem is, when I use the html() function to update the select tag, page moves to top without any reason...
My code :
- $('#chope-ta-moitie select[name=region]').sSelect({ddMaxHeight: '250px'}).change(function(){
- if($(this).getSetSSValue() != 'toutes') {
- $.get('modules/live/chope-ta-moitie.php', {type: 'region', valeur: $(this).getSetSSValue()}, function(data){
- $('#sous_region').html(data);
- $('#chope-ta-moitie select[name=sous_region]').sSelect({ddMaxHeight: '250px'});
- });
- }
- else $('#sous_region').html('');
- });
Do you have any idea, how to avoid this motion?
Best regards.