jQuery循环滚动新闻列表示例代码 - Web前端
作者:98wpeu发布时间:2026-06-04分类:网页前端技术浏览:8
导读:最近由于项目原因,学习了下JQuery,实现了一个小小的功能,就是点击公告的上一条下一条来查看滚动条。具体代码如下:复制代码代码如下:<!DOCtypehtmlPUBL...
最近由于项目原因,学习了下JQuery,实现了一个小小的功能,就是点击公告的上一条下一条来查看滚动条。具体代码如下:
复制代码 代码如下:
<!DOCtypehtml PUBLIC "-//W3C//DTD xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xHTML1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<metaHTTP-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="上一条"/>
<img src="break_btn.jpg" border="0" id='gg_s' style="Cursor: pointer;" title="暂停"/>
<img src="next_btn.jpg" border="0" id='gg_n' style="cursor: pointer;" title="下一条"/>
</li>
<li class="gg_info">
<a class="aa" style="cursor:hand" href="/notice/">
<b>网厅公告:</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="关于调整全省固定电话本地电话网营业区间通话费上限标准的通知">
<span style="width:300px;">关于调整全省固定电话本地电话网</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="中国电信机场/车站贵宾服务电子化认证公告">
<span style="width:300px;">中国电信机场/车站贵宾服务电子</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','播放');
}else{
jQuery(this).attr('src','/cms/web/images/V3/public/break_btn.jpg');
jQuery(this).attr('title','暂停');
}
});
});
</script>
复制代码 代码如下:
<!DOCtypehtml PUBLIC "-//W3C//DTD xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xHTML1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<metaHTTP-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="上一条"/>
<img src="break_btn.jpg" border="0" id='gg_s' style="Cursor: pointer;" title="暂停"/>
<img src="next_btn.jpg" border="0" id='gg_n' style="cursor: pointer;" title="下一条"/>
</li>
<li class="gg_info">
<a class="aa" style="cursor:hand" href="/notice/">
<b>网厅公告:</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="关于调整全省固定电话本地电话网营业区间通话费上限标准的通知">
<span style="width:300px;">关于调整全省固定电话本地电话网</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="中国电信机场/车站贵宾服务电子化认证公告">
<span style="width:300px;">中国电信机场/车站贵宾服务电子</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','播放');
}else{
jQuery(this).attr('src','/cms/web/images/V3/public/break_btn.jpg');
jQuery(this).attr('title','暂停');
}
});
});
</script>
相关推荐
- web前端设计师们常用的jQuery特效插件汇总 - Web前端
- jQuery/CSS3图片特效插件整理推荐 - Web前端
- jQuery提示效果代码分享 - Web前端
- 超炫的jquery仿flash导航栏特效 - Web前端
- ie8模式下click无反应点击option无反应的解决方法 - Web前端
- jquery中使用循环下拉菜单示例代码 - Web前端
- jquery制作select列表双向选择示例代码 - Web前端
- jquery实现多行文字图片滚动效果示例代码 - Web前端
- 在JavaScript中重写jQuery对象的方法实例教程 - Web前端
- javascript原生和jquery库实现iframe自适应高度和宽度 - Web前端
- 网页前端技术排行
- 最近发表
-
- WordPress随机显示特色图片插件:Random Post Thumbnails
- KeePass实现Chrome浏览器自动填充密码方法一
- LNMP一键包nginx 301强制跳转到https教程
- KeePass实现Chrome浏览器自动填充密码方法二
- #建站# 免费的VPS管理软件Xshell8/Xftp8中文版下载
- 使用Xshell 8连接VPS教程_电脑登录vps的方法
- WordPress评论界面添加烟花????效果
- 不同浏览器书签同步方案:坚果云+Floccus_详细使用教程
- iOS端KeePassXC客户端APP:Strongbox Password Safe
- 给WordPress评论中的Gravatar头像图片添加ALT属性


