-5

I wrote this code :

<html>
<head>
<title>Long Press</title>
</head>
<body>
<div id="refresh_page">
<button>long press to refresh</button>
</div>
</body>
</html>

I want to do that long press on button by mouse to refresh the page.but without using javascript.

Can any one help me ?

4
  • You could use the mouseup event Commented Mar 2, 2016 at 15:40
  • 5
    You can not do it without JavaScript.
    – Adam
    Commented Mar 2, 2016 at 15:42
  • 3
    Eh? You tagged your question with javascript and jquery - then edited the question to say "without using javascript"... Commented Mar 2, 2016 at 15:44
  • LOL! Nobody said it was easy... make it with javascript.... but without it! (QUANTUM JS) Commented Mar 2, 2016 at 15:49

2 Answers 2

4

If you REALLY don't want to use javascript - you can get long click in Flash!

actionscript 3:

private function mouseup(e:MouseEvent):void {
    stage.removeEventListener(MouseEvent.MOUSE_UP, mouseup);
    myTimer.reset();
}
private function showInfo(event:TimerEvent):void{
    //long press code
}
private function mousedown(event:MouseEvent):void{
    myTimer.start();
}

Impossible question = answered

2
  • 3
    You have indeed done the impossible: you made me upvote an answer that recommends using Flash. I salute you good sir Commented Mar 2, 2016 at 16:16
  • 5
    I hope no-one thinks I am actually recommending Flash... Commented Mar 2, 2016 at 16:18
1

You can achive this counting time that there's between mousedown and mouseup events.

This seems a duplicated question: How to apply long click event and doubleclick event on the same element in javascript

JS FIDDLE HERE

4
  • 1
    no java script dude, he updated the question Commented Mar 2, 2016 at 15:51
  • 1
    We've already said that this cannot be achived without javascript. And This Question is tagget as javascript. Commented Mar 2, 2016 at 15:54
  • 2
    answer is good but not at this question Commented Mar 2, 2016 at 15:57
  • meh... i've tried it :'( boohoo Commented Mar 2, 2016 at 15:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.