jQuery循环滚动新闻列表示例代码

 更新时间:2014年06月17日 09:23:57   投稿:whsnow  
jquery实现点击公告的上一条下一条来查看滚动条,示例代码如下,希望对大家有所帮助
最近由于项目原因,学习了下jquery,实现了一个小小的功能,就是点击公告的上一条下一条来查看滚动条。具体代码如下:
复制代码 代码如下:

<!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="上一条"/>
<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>

相关文章

  • jquery实现上下左右滑动的方法

    jquery实现上下左右滑动的方法

    这篇文章主要介绍了jquery实现上下左右滑动的方法,是jQuery特效中非常典型的应用,需要的朋友可以参考下
    2015-02-02
  • jquery 使用简明教程

    jquery 使用简明教程

    jQuery是目前使用最广泛的javascript函数库。据统计,全世界排名前100万的网站,有46%使用jQuery,远远超过其他库。微软公司甚至把jQuery作为他们的官方库。对于网页开发者来说,学会jQuery是必要的。因为它让你了解业界最通用的技术,为将来学习更高级的库打下基础,并且确实可以很轻松地做出许多复杂的效果
    2014-03-03
  • jquery实现可拖拽弹出层特效

    jquery实现可拖拽弹出层特效

    这篇文章主要介绍了jquery实现可拖拽弹出层特效,代码非常精简,效果非常棒,这里推荐给有需要的小伙伴
    2015-01-01
  • JQuery 又谈ajax局部刷新

    JQuery 又谈ajax局部刷新

    这篇文章主要为大家详细介绍了JQuery ajax局部刷新,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-11-11
  • jquery的父子兄弟节点查找示例代码

    jquery的父子兄弟节点查找示例代码

    这篇文章主要介绍了jquery的父子兄弟节点的查找方法,需要的朋友可以参考下
    2014-03-03
  • jQuery链式调用与show知识浅析

    jQuery链式调用与show知识浅析

    这篇文章主要介绍了jQuery的XX如何实现?——2.show与链式调用 的相关资料,非常具有参考借鉴价值,感兴趣的朋友一起学习吧
    2016-05-05
  • JQuery解析HTML、JSON和XML实例详解

    JQuery解析HTML、JSON和XML实例详解

    JQuery具有强大的解析数据的能力,本文详细介绍HTML、JSON和XML格式的文件的数据如何解析
    2014-03-03
  • jQuery实现类似滑动门切换效果的层切换

    jQuery实现类似滑动门切换效果的层切换

    滑动门切换效果想必大家都有见到过吧,在本文为大家介绍下jQuery是如何实现层切换的
    2013-09-09
  • JQuery选择器、过滤器大整理

    JQuery选择器、过滤器大整理

    这篇文章主要介绍了JQuery选择器、过滤器大整理,经过一晚上的查找整理,终于整理出一套应该算最全面的JQuery选择过滤器的方法了,需要的朋友可以参考下
    2015-05-05
  • jquery ui 1.7 ui.tabs 动态添加与关闭(按钮关闭+双击关闭)

    jquery ui 1.7 ui.tabs 动态添加与关闭(按钮关闭+双击关闭)

    jquery ui 1.7 ui.tabs 动态添加与关闭(按钮关闭+双击关闭)实现代码,需要的朋友可以参考下。
    2010-04-04

最新评论