Question

How to change the selector event handler? Function refreshThreshold() changes the frequency of triple mouse clicks.

My code does not work. More precisely, by changing the variable "thresholdVal" does not change the frequency of clicks ("threshold: thresholdVal" selector ).

Processing script tripleclick taken from here: https://github.com/richadams/jquery-tripleclick

function refreshThreshold() {
    thresholdVal = $( "#trippleclickSlider" ).slider( "value" );
    console.log(thresholdVal);
}

var thresholdVal = 1000;
$("#div").on("tripleclick", { threshold: thresholdVal }, function()
{
//any process
});
Was it helpful?

Solution

It sounds to me like the on tripleclick listener merely stores the value instead of referencing the variable.

Try changing your refreshThreshold() function to additionally reset the listener (re-call div.ontripleclick)

I hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top