Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jumps to the top of the page #1

Open
cdeyoung opened this issue Aug 28, 2012 · 1 comment
Open

Jumps to the top of the page #1

cdeyoung opened this issue Aug 28, 2012 · 1 comment

Comments

@cdeyoung
Copy link

If the bootstrap-transfer widget is included down far enough on the page that you have to scroll to see it, the page will jump back to the top whenever you move data from one column to the other. To fix the problem, you can add "return false; to the following functions:

        _this.$add_btn.click(function(){
            _this.move_elems(_this.$remaining_select.val(), false, true);
            return false;   <--  Add "return false;" to the function to keep the page from jumping back to the top"
        });
        _this.$remove_btn.click(function(){
            _this.move_elems(_this.$target_select.val(), true, false);
            return false;
        });
        _this.$choose_all_btn.click(function(){
            _this.move_all(false, true);
            return false;
        });
        _this.$clear_all_btn.click(function(){
            _this.move_all(true, false);
            return false;
        });
        _this.$filter_input.keyup(function(){
            _this.update_lists(true);
            return false;
        });

Thanks for the great plugin, by the way! It looks beautiful.

@mariela21180
Copy link

Other solution is that on the .js file, on every <a href="#"> element, replace the "#" to "javascript:void(0);" So It looks like this: <a href="javascript:void(0);">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants