61,112
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<meta charset="utf-8" />
<title>我的小站</title>
<link href="static/css/reset_css.css" rel="stylesheet" />
<link href="static/css/all.css" rel="stylesheet" />
<script src="static/js/jquery.js"></script>
<script src="static/js/jqueryxslider.js"></script>
</head>
<body>
<!-- banner结束 -->
<div id="NewsList">
<ul class="NewsList">
<li>我的小站</li>
<li>我的QQ </li>
<li>我的QQ群: </li>
<li><a href="#" target="_blank">很多好玩的内容</a></li>
</ul>
</div>
<!-- NewsList结束 -->
</body>
</html>
/*- - - - - - - - -样式属link.html - - - - - - - -*/
/*广告*/
/*图片轮播样式*/
#banner .conbox{width:999em;position:absolute;}
#banner .conbox div{float:left;width:500px;height:109px;overflow:hidden;}
#banner .conbox div img{width:100%;height:100%;display:block;}
#banner .switcher{float:right;position:absolute;right:5px;bottom:6px;z-index:99;}
#banner .switcher a{float:left;width:12px;height:12px;line-height:0;text-align:center;overflow:hidden;font-size:14px;font-family:arial;color:#323232;margin-left:4px;background-color:#5b5a58;border-radius:10px;cursor:pointer;display:inline;}
#banner .switcher a.cur,#banner .switcher a:hover{color:#fff;background-color:#3ba7cb;}
/*新闻列表*/
/*新闻列表*/
.NewsList{margin:0 17px;}
.NewsList li{padding:0 5px 0 7px;height:25px;line-height:25px;overflow:hidden;margin-bottom:8px;border-bottom:1px dashed #2d3f4b;}
.NewsList li span{float:right;}
/**
* @package Xslider - A slider plugin for jQuery
* @version 0.5
* @author xhowhy <http://x1989.com>
**/
;(function($){
$.fn.Xslider = function(options){var settings ={
affect: 'scrollx', //效果 有scrollx|scrolly|fade|none
speed: 1200, //动画速度
space: 6000, //时间间隔
auto: true, //自动滚动
trigger: 'mouseover', //触发事件 注意用mouseover代替hover
conbox: '.conbox', //内容容器id或class
ctag: 'a', //内容标签 默认为<a>
switcher: '.switcher', //切换触发器id或class
stag: 'a', //切换器标签 默认为a
current:'cur', //当前切换器样式名称
rand:false //是否随机指定默认幻灯图片
};
var len=$(this).find(".conbox>div")
var html=''
for (var i=1;i<=len.length;i++)
{
if (i==1)
{html+="<a href='#' class='cur'></a>"}
else
{html+="<a href='#'></a>" }
}
$(this).find(".conbox").after('<div class="switcher">'+html+'</div>')
settings = $.extend({}, settings, options);
var index = 1;
var last_index = 0;
var $conbox = $(this).find(settings.conbox),$contents = $conbox.find(settings.ctag);
var $switcher = $(this).find(settings.switcher),$stag = $switcher.find(settings.stag);
if(settings.rand) {index = Math.floor(Math.random()*$contents.length);slide();}
if(settings.affect == 'fade'){$.each($contents,function(k, v){(k === 0) ? $(this).css({'position':'absolute','z-index':9}):$(this).css({'position':'absolute','z-index':1,'opacity':0});
});
}
function slide(){if (index >= $contents.length) index = 0;
$stag.removeClass(settings.current).eq(index).addClass(settings.current);
switch(settings.affect){case 'scrollx':
$conbox.width($contents.length*$contents.width());
$conbox.stop().animate({left:-$contents.width()*index},settings.speed);
break;
case 'scrolly':
$contents.css({display:'block'});
$conbox.stop().animate({top:-$contents.height()*index+'px'},settings.speed);
break;
case 'fade':
$contents.eq(last_index).stop().animate({'opacity': 0}, settings.speed/2).css('z-index',1)
.end()
.eq(index).css('z-index',9).stop().animate({'opacity': 1}, settings.speed/2)
break;
case 'none':
$contents.hide().eq(index).show();
break;
}
last_index = index;
index++;
};
if(settings.auto) var Timer = setInterval(slide, settings.space);
$stag.bind(settings.trigger,function(){_pause()
index = $(this).index();
slide();
_continue()
});
$conbox.hover(_pause,_continue);
function _pause(){
clearInterval(Timer);
}
function _continue(){
if(settings.auto)Timer = setInterval(slide, settings.space);
}
}
})(jQuery);