var sID = 0;
var cID = 0;
function seite(element){
sID = $(element).attr('name');
// mit z.B. diesem alert geht es: ohne nicht..
alert("sag hallo");
document.getElementById("sid").innerHTML= sID;
}
function _utime(){
var d = new Date();
return Math.round(d.getTime());
}
var limit = 250;//0,5 sec.
var zeitgrenze,onholdtoolong;
function chk(elem){
zeitgrenze = _utime()+limit;
onholdtoolong = setTimeout(
function(){
if(onholdtoolong){
//showMenu(elem);
alert("lang gedrĂĽckt");
}
return; /*und wieder raus hier!*/
},limit
);
elem.onmouseup = function(){
onholdtoolong = false; /*schnell wieder weg damit, denn user hat losgelassen :D*/
if(_utime() >= zeitgrenze){
return; /*und wieder raus hier!*/
}
/*sonst das hier*/
//alert('kurz gedrueckt')
seite(elem);
}
}
$(".h_menu").mousedown(function(event) {
if (event.which == 1) {
chk(this);
};
// return false;
})
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.