我很好奇,是否可以计算切换次数?因为我有一个问题,当我将它悬停并多次悬停并选择其中一项时,该按钮将推到底部并且看不到。或者这是解决此问题的另一种方法?
已更新
即使我将鼠标悬停并悬停并再次悬停也不会多次它也会推到底部。
JS
$("#popup_survey_whitebox").hover(function () {
$('#popup_survey_whitebox_content').stop().animate({
opacity: 1,
height: "toggle"
}, 500, function () {
$("label#popup_survey_label_title").text(orig); // Here put the original text.
}).css('position', 'relative');
}, function () {
$('#popup_survey_whitebox_content').stop().animate({
opacity: 1,
height: "toggle"
}, 500, function () {
$("label#popup_survey_label_title").text(newText); // Here put the new text with "..."
}).css('position', 'relative');
});
最佳答案
最后我找到了解决这个问题的方法。
$("#popup_survey_whitebox").hover(function () {
$('#popup_survey_whitebox_content').finish().animate({
opacity: 1,
height: "toggle"
}, 500, function () {
$("label#popup_survey_label_title").text(orig); // Here put the original text.
}).css('position', 'relative');
}, function () {
$('#popup_survey_whitebox_content').finish().animate({
opacity: 1,
height: "toggle"
}, 500, function () {
$("label#popup_survey_label_title").text(newText); // Here put the new text with "..."
}).css('position', 'relative');
});
将两个动画的 $('#popup_survey_whitebox_content').stop()
更改为 $('#popup_survey_whitebox_content').finish()
关于javascript - 可以计算切换吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27812127/