I'm attempting to showcase one Tweet at a time and have it rotate through different tweets. I'm facing an issue where it works correctly on one type of page, but not on the other. Could this be due to a CSS precedence rule overriding the functionality?
Here is the structure of the HTML:
<div class="twitterFeed">
<p>Tweet here</p>
<p>Tweet here</p>
<p>Tweet here</p>
<p>Tweet here</p>
<p>Tweet here</p>
</div>
And here is the JavaScript code being used:
var currentTwitterItem = 4;
NextTwitterItem();
setInterval( NextTwitterItem, 8000);
function NextTwitterItem() {
currentTwitterItem++;
if (currentTwitterItem >= 5) {
currentTwitterItem = 0;
}
$(".twitterFeed p").hide();
$(".twitterFeed p:eq(" + currentTwitterItem + ")").show();
}