BPOVIA Website Design

Icon

Provides High-quality Web Design And Maintenance Service In The World

Display information with simple jQuery[1]

1. html display information structure, each message with <span> </ span>, refer to the following

<div class="test">
	<strong>&raquo;</strong><!-- style="display:none;"style.css -->
	<span style="display:none;">text text text  </span>
	<span style="display:none;">text text </span>
	<span style="display:none;">text </span>
</div>

2. JQuery code, specifically to see comments

jQuery(document).ready(function(){
	test(); 
	setInterval('test()', 6100); 
});
var test_i = 0, 
	test_span_arr = 0;
	test_span_num = 0; 
function test() {
	if(test_span_arr==0){
	test_span_arr = $(".test").children("span");
	test_span_num = test_span_arr.length - 1; 
	}
	if (test_i > test_span_num) {test_i = 0;} 
	$('.test span:eq('+test_i+')').fadeIn(1500); 
	setTimeout(function() {$('.test span:eq('+test_i+')').fadeOut(1500);test_i++;},4500);
};

BPOVIA All Rights Reserved
Maintained by BPOVIA Web Design Team

Category: WordPress

Tagged: ,

Comments are closed.