Tuesday, September 4, 2012

Ctrl+Home and Ctrl+End in jquey

Write the script in master page if you want add information when you click on ctrl+home and ctrl+end

 $(document).keydown(function (e) {
            if (ctrl_down && (e.keyCode == ctl_home)) {
               window.scrollTo(0,0);
                // Your code
                return false;
            }
            else if (ctrl_down && (e.keyCode == ctrl_end)) {
                window.scrollTo(0, document.body.scrollHeight);                // Your code
                return false;
            }
        });