javascript: dblclick oralig'i aniqlanmaydi

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

                                 //sets loop to zero 
                var totalTenths = 0;
                var interval;
                var startButton = document.querySelector('#start');

               //start and pause button 
                document.querySelector('#start').addEventListener('click', function (e) {
                    var startButton = e.target;

                    if (startButton.innerHTML === 'Start') {
                        startButton.innerHTML = 'Pause';
                        interval = setInterval(countTimer, 10)
                        colorInterval = setInterval(colorTimer, 1000) 
                    }
                    else if (e.target.innerHTML === 'Pause') {
                        startButton.innerHTML = 'Resume';
                        clearInterval(interval);
                        clearInterval(colorInterval);
                       //here I'm setting the 15 second restart interval
                        waitedTooLong = setInterval(timeout, 15000)
                    }
                    else if (startButton.innerHTML === 'Resume') {
                        startButton.innerHTML = 'Pause';
                        interval = setInterval(countTimer, 10)
                        colorInterval = setInterval(colorTimer, 1000)
                    }
                });

               //double click to clear function 
                document.querySelector('#start').addEventListener('dblclick', function(e) {
                    var startButton = e.target;
                    if (startButton.innerHTML === 'Resume') {
                        clearInterval(function() {
                            setInterval(countTimer, 10)
                        });
                        document.getElementById('tenths').innerHTML = '00';
                        document.getElementById('seconds').innerHTML = '00';
                        document.getElementById('minutes').innerHTML = '00';
                        document.getElementById('start').innerHTML = 'Start'
                    }
                });
               //loop that converts 10th of millisec to minute and seconds
                function countTimer() {
                    totalTenths++;
                    var minutes = Math.floor(totalTenths/6000);
                    var seconds = Math.floor((totalTenths - minutes * 6000)/100);
                    var tenths = totalTenths - (minutes * 6000 + seconds * 100);

                   //replaces inner html with loop with added zero until double digits accure
                    if (tenths > 0) {
                        document.getElementById('tenths').innerHTML = '0' + tenths;
                    }
                    if (tenths > 9) {
                        document.getElementById('tenths').innerHTML = tenths;
                    }
                    if (tenths > 9) {
                        document.getElementById('seconds').innerHTML = '0' + seconds;
                    }
                    if (seconds > 9) {
                        document.getElementById('seconds').innerHTML = seconds;
                    }
                    if (tenths > 0) {
                        document.getElementById('minutes').innerHTML = '0' + minutes;
                        }
                    if (minutes > 9) {
                        document.getElementById('minutes').innerHTML = minutes;
                    }
                }
                
               <div class="text-center container">
                    <button id="start" class="btn btn-large btn-success">Start</button> 
                    
double click to clear!

<div id="timer" class="well"> 00:00:00 </div> </div>
</div> </div>

Hisoblagich taymerini ishlaydigan interval deb ataladigan intervalli bor. Men birinchi boshlang'ich sichqoncha ustida boshlanadigan boshlang'ich tugmani bosib, ikkinchi marta to'xtashim kerak. Ikki marta chertganimda, taymerni nolga qaytaradi, lekin asl taymerni tozalash kabi ko'rinmaydi. Displey nolga almashtirilgunga qadar faqatgina qaerda qoldi.

0
Intervalni qaerga o'rnatasiz? Bizga tegishli barcha kodlarni ko'rsating.
qo'shib qo'ydi muallif Scott Marcus, manba
Sizni bezovta qilmaslikka harakat qilmang, lekin siz yaxshi savol berish uchun vaqt ajratib qo'ysangiz, eng yaxshi javobni qo'lga kiritasiz. @Xufox yuqorida aytib o'tilganidek, biz hamma narsani xohlamaymiz, lekin stackoverflow.com/help/mcve ni xohlaymiz
qo'shib qo'ydi muallif Scott Marcus, manba
Sizni bezovta qilmaslikka harakat qilmang, lekin siz yaxshi savol berish uchun vaqt ajratib qo'ysangiz, eng yaxshi javobni qo'lga kiritasiz. @Xufox yuqorida aytib o'tilganidek, biz hamma narsani xohlamaymiz, lekin stackoverflow.com/help/mcve ni xohlaymiz
qo'shib qo'ydi muallif Scott Marcus, manba
Sizni bezovta qilmaslikka harakat qilmang, lekin siz yaxshi savol berish uchun vaqt ajratib qo'ysangiz, eng yaxshi javobni qo'lga kiritasiz. @Xufox yuqorida aytib o'tilganidek, biz hamma narsani xohlamaymiz, lekin stackoverflow.com/help/mcve ni xohlaymiz
qo'shib qo'ydi muallif Scott Marcus, manba
Men sizning intervalingizdan boshlanadigan kodni hali ham ko'rmayapman.
qo'shib qo'ydi muallif Scott Marcus, manba
Men sizning intervalingizdan boshlanadigan kodni hali ham ko'rmayapman.
qo'shib qo'ydi muallif Scott Marcus, manba
Iltimos, barcha tegishli kodni qo'shing .... HTML ham.
qo'shib qo'ydi muallif Scott Marcus, manba
Iltimos, barcha tegishli kodni qo'shing .... HTML ham.
qo'shib qo'ydi muallif Scott Marcus, manba
Iltimos, kodingizni sharh sifatida yubormang. Barcha tegishli kodni (bu holatda HTML va JavaScript) o'z ichiga olish uchun savolingizni tahrirlang.
qo'shib qo'ydi muallif Scott Marcus, manba
Iltimos, kodingizni sharh sifatida yubormang. Barcha tegishli kodni (bu holatda HTML va JavaScript) o'z ichiga olish uchun savolingizni tahrirlang.
qo'shib qo'ydi muallif Scott Marcus, manba
Iltimos, kodingizni sharh sifatida yubormang. Barcha tegishli kodni (bu holatda HTML va JavaScript) o'z ichiga olish uchun savolingizni tahrirlang.
qo'shib qo'ydi muallif Scott Marcus, manba
Intervalni qaerga o'rnatasiz? Bizga tegishli barcha kodlarni ko'rsating.
qo'shib qo'ydi muallif Scott Marcus, manba
qo'shib qo'ydi muallif Xufox, manba
qo'shib qo'ydi muallif Xufox, manba
qo'shib qo'ydi muallif Xufox, manba
@ScottMarcus tahrirlarni qo'shdi. Hukmni asl faylning yuqori qismida e'lon qildi
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus tahrirlarni qo'shdi. Hukmni asl faylning yuqori qismida e'lon qildi
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus oldinga bordi va hamma narsani qo'shdi
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus oldinga bordi va hamma narsani qo'shdi
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus oldinga bordi va hamma narsani qo'shdi
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus ishonchli narsa. yordamni qadrlang
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus ishonchli narsa. yordamni qadrlang
qo'shib qo'ydi muallif gabe1331, manba
@ScottMarcus ishonchli narsa. yordamni qadrlang
qo'shib qo'ydi muallif gabe1331, manba

6 javoblar

Sizning asosiy muammolaringiz totalTenths global o'zgaruvchisiga aylandi, uni ikki marta bosishdan so'ng qayta tiklanmadi. Siz shuningdek, colorInterval taymerini ham takrorlashdan yoki er-xotin bosishingizdan keyin o'chirmadingiz. Ikkala taymerni ham to'g'ri o'ldirish, o'zgaruvchining asl holatini tiklash va ekranni qayta ishga tushirish muammoni hal qiladi.

So'ngra, deklaratsiyani tashkil qilish bu erda katta yordam bo'lishi mumkin. Hujjatni bir xil elementlar uchun qayta-qayta tekshirish o'rniga, kesh ularni o'zgaruvchilarga havola qiladi.

Bundan tashqari colorTimer funktsiyasi ham keraksiz bo'lib, unda changeColor funktsiyasini saralaydi.

Va nihoyat, bir nechta taymer bilan juda muhim, chunki har doim boshqa funksiyani ishga tushirishdan oldin har doim ishlaydigan taymerlarni to'xtatish kerak. iborasi bo'lsa, sizning "klik" voqea işleyicinizin ning oxirgi qismida ham taymerlaringizni tozalash kerak edi.

Kodni takrorlash ko'p narsalarni o'qish va disk raskadrovka qilishni qiyinlashtiradi. Kodlashda DRY (o'zingizni takrorlamang) tamoyiliga amal qiling. Agar siz o'zingizni ikki marta bir xil kodni topsangiz, ehtimol noto'g'ri narsa qilasiz. Quyidagilarni tushuntirish uchun sharhlar bilan sharhlar juda ham ixcham va tozalangan:

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

// sets loop to zero 

// This is the varible that essentially hold the elapsed time. It's global so it must be 
// reset upon a timeout or a double-click
var totalTenths = 0;

// Always initialize your variables to something, use null if you don't 
// have an actual value yet.
var interval = null;
var colorInterval = null;
var waitedTooLong = null;

// Get DOM references just once and then use them throughout the rest of the code
var startButton = document.getElementById('start');
var m = document.getElementById('minutes');
var s = document.getElementById('seconds');
var t = document.getElementById('tenths');

// start and pause button 
startButton.addEventListener('click', function (e) {
 //No need to test what object you're dealing with
 //you are here because the start button got clicked
 //that makes "this" === startButton

 //Don't use .innerHTML when you are only working with raw text
 //use textContent instead.
  if (this.textContent === 'Start') {
    startButton.textContent = 'Pause';
    interval = setInterval(countTimer, 10)
    colorInterval = setInterval(changeColor, 1000) 
  } else if (this.textContent === 'Pause') {
    startButton.textContent = 'Resume';
    clearInterval(interval);
    clearInterval(colorInterval);
    
   //here I'm setting the 15 second restart interval
    waitedTooLong = setInterval(timeout, 15000)
  } else {
   //Clear prior timers
    clearInterval(interval);
    clearInterval(colorInterval);
    
    this.textContent = 'Pause';
    interval = setInterval(countTimer, 10)
    colorInterval = setInterval(changeColor, 1000)
  }
});

// double click to clear function which is the same as the timeout function
startButton.addEventListener('dblclick', timeout);

// changes second's color
function changeColor() {
  var red = Math.round(Math.random() * 255);
  var green = Math.round(Math.random() * 255);
  var blue = Math.round(Math.random() * 255);
  
  s.style.color = 'rgb(' + red + ', ' + green + ', ' + blue + ')';
}

// loop that converts 10th of millisec to minute and seconds
function countTimer() {
  totalTenths++;
  var minutes = Math.floor(totalTenths/6000);
  var seconds = Math.floor((totalTenths - minutes * 6000)/100);
  var tenths = totalTenths - (minutes * 6000 + seconds * 100);

 //replaces inner html with loop with added zero until double digits accure
  if (tenths > 0) { t.textContent = '0' + tenths; }
  if (tenths > 9) { t.textContent = tenths; }
  if (tenths > 9) { s.textContent = '0' + seconds;  }
  if (seconds > 9) { s.textContent = seconds; }
  if (tenths > 0) { m.textContent = '0' + minutes; }
  if (minutes > 9) { m.textContent = minutes; }
}

// 15 second restart funciton
function timeout() {
  clearInterval(interval);
  clearInterval(colorInterval);
  
  t.textContent = '00';
  s.textContent = '00';
  m.textContent = '00';
  startButton.textContent = 'Start'
  s.style.color = "#000";
  
 //You must reset this global variable for the counter to reset properly
  totalTenths = 0; // <<------------------------ 
}
<script type="text/javascript" src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch,Array.prototype.includes"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="text-center container">
  <button id="start" class="btn btn-large btn-success">Start</button> 
  
double click to clear!

<div id="timer" class="well"> 00: 00: 00 </div> </div>
</div> </div>
0
qo'shib qo'ydi

Sizning asosiy muammolaringiz totalTenths global o'zgaruvchisiga aylandi, uni ikki marta bosishdan so'ng qayta tiklanmadi. Siz shuningdek, colorInterval taymerini ham takrorlashdan yoki er-xotin bosishingizdan keyin o'chirmadingiz. Ikkala taymerni ham to'g'ri o'ldirish, o'zgaruvchining asl holatini tiklash va ekranni qayta ishga tushirish muammoni hal qiladi.

So'ngra, deklaratsiyani tashkil qilish bu erda katta yordam bo'lishi mumkin. Hujjatni bir xil elementlar uchun qayta-qayta tekshirish o'rniga, kesh ularni o'zgaruvchilarga havola qiladi.

Bundan tashqari colorTimer funktsiyasi ham keraksiz bo'lib, unda changeColor funktsiyasini saralaydi.

Va nihoyat, bir nechta taymer bilan juda muhim, chunki har doim boshqa funksiyani ishga tushirishdan oldin har doim ishlaydigan taymerlarni to'xtatish kerak. iborasi bo'lsa, sizning "klik" voqea işleyicinizin ning oxirgi qismida ham taymerlaringizni tozalash kerak edi.

Kodni takrorlash ko'p narsalarni o'qish va disk raskadrovka qilishni qiyinlashtiradi. Kodlashda DRY (o'zingizni takrorlamang) tamoyiliga amal qiling. Agar siz o'zingizni ikki marta bir xil kodni topsangiz, ehtimol noto'g'ri narsa qilasiz. Quyidagilarni tushuntirish uchun sharhlar bilan sharhlar juda ham ixcham va tozalangan:

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

// sets loop to zero 

// This is the varible that essentially hold the elapsed time. It's global so it must be 
// reset upon a timeout or a double-click
var totalTenths = 0;

// Always initialize your variables to something, use null if you don't 
// have an actual value yet.
var interval = null;
var colorInterval = null;
var waitedTooLong = null;

// Get DOM references just once and then use them throughout the rest of the code
var startButton = document.getElementById('start');
var m = document.getElementById('minutes');
var s = document.getElementById('seconds');
var t = document.getElementById('tenths');

// start and pause button 
startButton.addEventListener('click', function (e) {
 //No need to test what object you're dealing with
 //you are here because the start button got clicked
 //that makes "this" === startButton

 //Don't use .innerHTML when you are only working with raw text
 //use textContent instead.
  if (this.textContent === 'Start') {
    startButton.textContent = 'Pause';
    interval = setInterval(countTimer, 10)
    colorInterval = setInterval(changeColor, 1000) 
  } else if (this.textContent === 'Pause') {
    startButton.textContent = 'Resume';
    clearInterval(interval);
    clearInterval(colorInterval);
    
   //here I'm setting the 15 second restart interval
    waitedTooLong = setInterval(timeout, 15000)
  } else {
   //Clear prior timers
    clearInterval(interval);
    clearInterval(colorInterval);
    
    this.textContent = 'Pause';
    interval = setInterval(countTimer, 10)
    colorInterval = setInterval(changeColor, 1000)
  }
});

// double click to clear function which is the same as the timeout function
startButton.addEventListener('dblclick', timeout);

// changes second's color
function changeColor() {
  var red = Math.round(Math.random() * 255);
  var green = Math.round(Math.random() * 255);
  var blue = Math.round(Math.random() * 255);
  
  s.style.color = 'rgb(' + red + ', ' + green + ', ' + blue + ')';
}

// loop that converts 10th of millisec to minute and seconds
function countTimer() {
  totalTenths++;
  var minutes = Math.floor(totalTenths/6000);
  var seconds = Math.floor((totalTenths - minutes * 6000)/100);
  var tenths = totalTenths - (minutes * 6000 + seconds * 100);

 //replaces inner html with loop with added zero until double digits accure
  if (tenths > 0) { t.textContent = '0' + tenths; }
  if (tenths > 9) { t.textContent = tenths; }
  if (tenths > 9) { s.textContent = '0' + seconds;  }
  if (seconds > 9) { s.textContent = seconds; }
  if (tenths > 0) { m.textContent = '0' + minutes; }
  if (minutes > 9) { m.textContent = minutes; }
}

// 15 second restart funciton
function timeout() {
  clearInterval(interval);
  clearInterval(colorInterval);
  
  t.textContent = '00';
  s.textContent = '00';
  m.textContent = '00';
  startButton.textContent = 'Start'
  s.style.color = "#000";
  
 //You must reset this global variable for the counter to reset properly
  totalTenths = 0; // <<------------------------ 
}
<script type="text/javascript" src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch,Array.prototype.includes"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="text-center container">
  <button id="start" class="btn btn-large btn-success">Start</button> 
  
double click to clear!

<div id="timer" class="well"> 00: 00: 00 </div> </div>
</div> </div>
0
qo'shib qo'ydi

Sizning asosiy muammolaringiz totalTenths global o'zgaruvchisiga aylandi, uni ikki marta bosishdan so'ng qayta tiklanmadi. Siz shuningdek, colorInterval taymerini ham takrorlashdan yoki er-xotin bosishingizdan keyin o'chirmadingiz. Ikkala taymerni ham to'g'ri o'ldirish, o'zgaruvchining asl holatini tiklash va ekranni qayta ishga tushirish muammoni hal qiladi.

So'ngra, deklaratsiyani tashkil qilish bu erda katta yordam bo'lishi mumkin. Hujjatni bir xil elementlar uchun qayta-qayta tekshirish o'rniga, kesh ularni o'zgaruvchilarga havola qiladi.

Bundan tashqari colorTimer funktsiyasi ham keraksiz bo'lib, unda changeColor funktsiyasini saralaydi.

Va nihoyat, bir nechta taymer bilan juda muhim, chunki har doim boshqa funksiyani ishga tushirishdan oldin har doim ishlaydigan taymerlarni to'xtatish kerak. iborasi bo'lsa, sizning "klik" voqea işleyicinizin ning oxirgi qismida ham taymerlaringizni tozalash kerak edi.

Kodni takrorlash ko'p narsalarni o'qish va disk raskadrovka qilishni qiyinlashtiradi. Kodlashda DRY (o'zingizni takrorlamang) tamoyiliga amal qiling. Agar siz o'zingizni ikki marta bir xil kodni topsangiz, ehtimol noto'g'ri narsa qilasiz. Quyidagilarni tushuntirish uchun sharhlar bilan sharhlar juda ham ixcham va tozalangan:

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

// sets loop to zero 

// This is the varible that essentially hold the elapsed time. It's global so it must be 
// reset upon a timeout or a double-click
var totalTenths = 0;

// Always initialize your variables to something, use null if you don't 
// have an actual value yet.
var interval = null;
var colorInterval = null;
var waitedTooLong = null;

// Get DOM references just once and then use them throughout the rest of the code
var startButton = document.getElementById('start');
var m = document.getElementById('minutes');
var s = document.getElementById('seconds');
var t = document.getElementById('tenths');

// start and pause button 
startButton.addEventListener('click', function (e) {
 //No need to test what object you're dealing with
 //you are here because the start button got clicked
 //that makes "this" === startButton

 //Don't use .innerHTML when you are only working with raw text
 //use textContent instead.
  if (this.textContent === 'Start') {
    startButton.textContent = 'Pause';
    interval = setInterval(countTimer, 10)
    colorInterval = setInterval(changeColor, 1000) 
  } else if (this.textContent === 'Pause') {
    startButton.textContent = 'Resume';
    clearInterval(interval);
    clearInterval(colorInterval);
    
   //here I'm setting the 15 second restart interval
    waitedTooLong = setInterval(timeout, 15000)
  } else {
   //Clear prior timers
    clearInterval(interval);
    clearInterval(colorInterval);
    
    this.textContent = 'Pause';
    interval = setInterval(countTimer, 10)
    colorInterval = setInterval(changeColor, 1000)
  }
});

// double click to clear function which is the same as the timeout function
startButton.addEventListener('dblclick', timeout);

// changes second's color
function changeColor() {
  var red = Math.round(Math.random() * 255);
  var green = Math.round(Math.random() * 255);
  var blue = Math.round(Math.random() * 255);
  
  s.style.color = 'rgb(' + red + ', ' + green + ', ' + blue + ')';
}

// loop that converts 10th of millisec to minute and seconds
function countTimer() {
  totalTenths++;
  var minutes = Math.floor(totalTenths/6000);
  var seconds = Math.floor((totalTenths - minutes * 6000)/100);
  var tenths = totalTenths - (minutes * 6000 + seconds * 100);

 //replaces inner html with loop with added zero until double digits accure
  if (tenths > 0) { t.textContent = '0' + tenths; }
  if (tenths > 9) { t.textContent = tenths; }
  if (tenths > 9) { s.textContent = '0' + seconds;  }
  if (seconds > 9) { s.textContent = seconds; }
  if (tenths > 0) { m.textContent = '0' + minutes; }
  if (minutes > 9) { m.textContent = minutes; }
}

// 15 second restart funciton
function timeout() {
  clearInterval(interval);
  clearInterval(colorInterval);
  
  t.textContent = '00';
  s.textContent = '00';
  m.textContent = '00';
  startButton.textContent = 'Start'
  s.style.color = "#000";
  
 //You must reset this global variable for the counter to reset properly
  totalTenths = 0; // <<------------------------ 
}
<script type="text/javascript" src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch,Array.prototype.includes"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="text-center container">
  <button id="start" class="btn btn-large btn-success">Start</button> 
  
double click to clear!

<div id="timer" class="well"> 00: 00: 00 </div> </div>
</div> </div>
0
qo'shib qo'ydi

Fikr bildirish sharafi yo'q, shuning uchun bu erda. Bu to'liq javob emas, ilovalar orqali ishlashdan nafratlanmaydi.

Men izlaganimdan va bilishimcha, ikki marta bosishdan oldin sekin urishadi. Uzoq muddatli matbuot yoki biror narsaga o'xshash boshqa narsalarni sinashingiz mumkin. Yoki ushbu usulni qo'llashingiz mumkin,

Biror elementga ikkita onclick va ondblclick qanday ishlatiladi?

Siz nima qilishingiz kerak bo'lsa, sekin urish bilan tugash vaqtini belgilab qo'ying va u juft yoki juft deb biladimi. O'ylaymanki, buni qilish kerak.

Men kompozitsiyamga kirsam, kodni sinab ko'rsata olaman. Kuningiz yahshi o'tsin.

0
qo'shib qo'ydi

Fikr bildirish sharafi yo'q, shuning uchun bu erda. Bu to'liq javob emas, ilovalar orqali ishlashdan nafratlanmaydi.

Men izlaganimdan va bilishimcha, ikki marta bosishdan oldin sekin urishadi. Uzoq muddatli matbuot yoki biror narsaga o'xshash boshqa narsalarni sinashingiz mumkin. Yoki ushbu usulni qo'llashingiz mumkin,

Biror elementga ikkita onclick va ondblclick qanday ishlatiladi?

Siz nima qilishingiz kerak bo'lsa, sekin urish bilan tugash vaqtini belgilab qo'ying va u juft yoki juft deb biladimi. O'ylaymanki, buni qilish kerak.

Men kompozitsiyamga kirsam, kodni sinab ko'rsata olaman. Kuningiz yahshi o'tsin.

0
qo'shib qo'ydi

Fikr bildirish sharafi yo'q, shuning uchun bu erda. Bu to'liq javob emas, ilovalar orqali ishlashdan nafratlanmaydi.

Men izlaganimdan va bilishimcha, ikki marta bosishdan oldin sekin urishadi. Uzoq muddatli matbuot yoki biror narsaga o'xshash boshqa narsalarni sinashingiz mumkin. Yoki ushbu usulni qo'llashingiz mumkin,

Biror elementga ikkita onclick va ondblclick qanday ishlatiladi?

Siz nima qilishingiz kerak bo'lsa, sekin urish bilan tugash vaqtini belgilab qo'ying va u juft yoki juft deb biladimi. O'ylaymanki, buni qilish kerak.

Men kompozitsiyamga kirsam, kodni sinab ko'rsata olaman. Kuningiz yahshi o'tsin.

0
qo'shib qo'ydi
Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb