I have two divs in my html page and I want to show one div on hide of other and show other on hide of first automatically after each 5 seconds. I am writing this in my document.ready but it is not working. It only hides first div and shows it and then it does nothing.
$("#free-trial-link").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
$('#free-trial-link').fadeIn(function() {
$('#record-call-link').fadeIn();
});
$('#record-call-link').fadeIn(function() {
$('#free-trial-link').fadeIn();
});
Markup is:
<div class="container_content" style="padding-top: 10px;">
<p class="date_day" id="p-free-trial-link" style="display: none">
<img id="free-trial-link" style="cursor: pointer;" src="images/tial-icon.png" width="32"
height="32"><br>
Free Trial
</p>
<p class="date_day" style="text-align: right; margin-top: 25px;" id="p-record-call-link">
<img id="record-call-link" style="position: inherit; cursor: pointer;" src="images/record-icon.png"
width="32" height="32"><br>
Record a Call
</p>
<div class="clear-n">
</div>
</div>