Click and Hold event listener with Javascript
问题 I want to make a page with Click and Hold event effect, like http://andeinerseite.video/ or http://2016.makemepulse.com/, I'm interested in what framework uses to create those effects. 回答1: You can use Javascript's setTimeout function and bind it to mousedown events. Have a look at the snippet below: // click and hold event listener var timeout_id = 0, hold_time = 1000, hold_menu = $('.hold_menu'), hold_trigger = $('.hold_trigger'); hold_menu.hide(); hold_trigger.mousedown(function() {