vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.73k forks source link

How to prevent jumping to top of page? #1090

Open hemiad opened 6 years ago

hemiad commented 6 years ago

Hello when the page have scroll and click to edit field the scroll jump to top page , i have tested this solution but not work : https://stackoverflow.com/questions/3252730/how-to-prevent-a-click-on-a-link-from-jumping-to-top-of-page?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa Sorry for my bad english Best regards

stefkes commented 6 years ago

The accepted answer there (below) should work. If not, please post your code

$('a.someclass').click(function(e)
{
    e.preventDefault();
});
hemiad commented 6 years ago

Hello not works , this my code :

$('a').click(function(e)
        {
            e.preventDefault();
        });
        $.fn.editable.defaults.mode = 'popup';
        //make username editable
        $('a.lien').editable({
            url: '/?do=liens&action=save'
        });
        $('a.episode').editable({
            url: '/?do=liens&action=save_episode',
        });
        $('a.saison').editable({
            url: '/?do=liens&action=save_saison',

        });