JQuery circular scrolling news list sample code

  • 2020-03-30 03:22:50
  • OfStack

Recently, due to project reasons, I learned jquery and realized a small function, which is to click on the last one of the announcement to see the scroll bar. The specific code is as follows:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=GBK" /> 
<meta http-equiv="X-UA-Compatible" content="IE=7" /> 
<meta name="keywords" content=""><meta name="description" content=""> 
<title>test</title> 
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script> 

<style> 
.banner_index { float:left; width:730px; height:239px; overflow:hidden; margin:5px 0 0 0;} 
.banner_index_pic { width:730px; height:239px; overflow:hidden;} 
</style> 
</head> 
<body scroll="yes"> 
<script type="text/javascript" src="jcarousellite_1.0.1.js"></script> 
<div class="gg"> 
<li class="gg_btn"> 
<img src="pre_btn.jpg" border="0" id='gg_p' style="cursor: pointer;" title=" On a "/> 
<img src="break_btn.jpg" border="0" id='gg_s' style="cursor: pointer;" title=" suspended "/> 
<img src="next_btn.jpg" border="0" id='gg_n' style="cursor: pointer;" title=" The next article "/> 
</li> 
<li class="gg_info"> 
<a class="aa" style="cursor:hand" href="/notice/"> 
<b> Net office announcement: </b></a> 
<div id="dt_gg" style="display: none; float: left; width: 450px;"> 
<ul style="height:25px;overflow:hidden;"> 
<li style="width: 300px"> 
<a class="aa" href="/cms/web/default/new/notice/50514.shtml" title=" Notice on the adjustment of provincial fixed telephone local telephone network operating range call fee ceiling standard "> 
<span style="width:300px;"> About the adjustment of the provincial fixed telephone local telephone network </span> 
</a> 
<span style="width:100px;">[2010-06-24]</span> 
</li> 
<li style="width: 300px"> 
<a class="aa" href="/cms/web/default/new/notice/50515.shtml" title=" China telecom airport / Station VIP service electronic certification announcement "> 
<span style="width:300px;"> China telecom airport / Station VIP service electronic </span> 
</a> 
<span style="width:100px;">[2010-06-24]</span> 
</li> 
</ul> 
</div> 
</li> 
</div> 
<script type="text/javascript"> 
jQuery(function(){ 
jQuery('#dt_gg').css("display","block"); 
if(jQuery('#dt_gg').find('li').length>1){ 
jQuery('#dt_gg').jCarouselLite({ 
btnPrev:'#gg_n', 
btnNext:'#gg_p', 
btnAutoSwitch:'#gg_s', 
visible: 1, 
auto:5000, 
speed:1000, 
onMouse:true, 
vertical:true 
}); 
}else{ 
jQuery('#dt_gg').jCarouselLite({ 
visible: 1 
}); 
} 
}); 
jQuery(function(){ 
jQuery('#gg_s').click(function(){ 
if(jQuery(this).attr('src') == "/cms/web/images/V3/public/break_btn.jpg"){ 
jQuery(this).attr('src','/cms/web/images/V3/public/play_btn.jpg'); 
jQuery(this).attr('title',' play '); 
}else{ 
jQuery(this).attr('src','/cms/web/images/V3/public/break_btn.jpg'); 
jQuery(this).attr('title',' suspended '); 
} 
}); 
}); 
</script> 

Related articles: