我已经编写了一个函数来在三个链接之间放置“,”和“ and”,如果没有其他语句,我该如何减少。在javascript中,如果count不为零,我将得到count,这意味着链接必须显示,否则应该隐藏
在以下情况下
function inst_grammer()
{
var otherCount = parseInt($('.global_other_count').html());
var initCount = parseInt($('.global_init_count').html());
var signCount = parseInt($('.global_sign_count').html());
var init_class = $('.inst_init');
var sign_class = $('.inst_sign');
if (signCount != 0 && initCount != 0 && otherCount == 0)
{
init_class.html('').fadeOut();
sign_class.html(' and ').fadeIn();
} else if (signCount == 0 && initCount != 0 && otherCount != 0)
{
init_class.html(' and ').fadeIn();
sign_class.html('');
} else if (signCount != 0 && initCount != 0 && otherCount != 0)
{
init_class.html(' and ').fadeIn();
sign_class.html(' , ').fadeIn();
}
else if (signCount != …Run Code Online (Sandbox Code Playgroud) 如果使用 jquery 向左或向右移动范围滑块,我想找到实时。感谢以下是我目前的实现。
$("#zoom-slider").on("input", function(e) {
var curr_val = $("#zoom-slider").val();
if( curr_val > zoom_slider )
{
console.log( " +ive : right" );
}else
{
console.log( " -ive : left" );
}
zoom_slider = curr_val;
});
Run Code Online (Sandbox Code Playgroud)
但我问是否有任何事件。