0
Мне нужно отобразить html простой математической подстановки.Простая математическая подстановка (jquery)
treshold - count = currentCount
Ниже мой текущий сценарий - он работает правильно, чтобы скрыть/показать DIV. Но мне нужно, чтобы изменить код, чтобы он также будет отображать currentCount
в HTML
var threshold = 100; // Number to trigger on
var widgets_to_hide = ["#promotion"]; // CSS selectors of widgets to hide when triggered
var widgets_to_show = ["#text"]; // CSS selectors of widgets to show when triggered
$(function(){
$('.ss_entry_count').on('changed.content', function(event){
var count = parseInt($('.ss_entry_count_value', this).text());
if(count - threshold){
$.each(widgets_to_hide, function(i){
$(widgets_to_hide[i]).hide();
});
$.each(widgets_to_show, function(i){
$(widgets_to_show[i]).show();
});
}
});
});
<span id="result"></span>
p.s.w.g - Вы спасли день: D – aksupersurfer