Health Tip always shows the hot car tip (summertip). The var tipidx always gets reset back to 0 when it loops.
How about adding randomness instead? Tested and works:
let summertipidx = Math.round(Math.random() (summertips.length-1));
let wintertipidx = Math.round(Math.random() (wintertips.length-1));
Open them like this:
$('.' + summertips[summertipidx]).show();
$('.' + wintertips[wintertipidx]).show();
Then close them like this so they don't pile up:
$('.' + summertips[summertipidx]).hide();
$('.' + wintertips[wintertipidx]).hide();
Health Tip always shows the hot car tip (summertip). The var tipidx always gets reset back to 0 when it loops.
How about adding randomness instead? Tested and works: let summertipidx = Math.round(Math.random() (summertips.length-1)); let wintertipidx = Math.round(Math.random() (wintertips.length-1));
Open them like this: $('.' + summertips[summertipidx]).show(); $('.' + wintertips[wintertipidx]).show();
Then close them like this so they don't pile up: $('.' + summertips[summertipidx]).hide(); $('.' + wintertips[wintertipidx]).hide();