html的div内换页,jQuery+css实现的换页标签栏效果

本文实例讲述了jQuery+css实现的换页标签栏效果。分享给大家供大家参考,具体如下:

运行效果截图如下:

846933e1619dfe2dd676818828224748.png

具体代码如下:

index

body {

margin:0; padding:0; font-size:12px; color:gray;

}

.container {

height:200px; background:#F2F2F2; border-radius:6px;

-webkit-border-radius:6px; -moz-border-radius:6px; border:6px solid #D5D5D5;

}

.wrapper {

width:90%; margin:0px auto;

}

.pageContainer {

margin:0 auto; height:30px; position:relative; width:100%;

}

.page {

width:30px; height:30px; background:#494949; border-radius:30px; margin-left:5px;

-webkit-border-radius:30px; -moz-border-radius:30px; line-height:30px; font-size:15px;

display:block; text-align:center; color:#fff; float:left; cursor:pointer; float:left;

margin-top:5px;

}

.page:hover {

background:#42CFFD; font-weight:bolder;

}

.page.active {

background:#0864C0;

}

(function(){

$.fn.pageCreate = function(url, allPage, currentPage, pageTarget){

if(isNaN(allPage) || allPage < 1 || isNaN(currentPage) || currentPage < 1 || $.trim(url) == "") {

return;

}

var html = [],

self = $(this),

pageTarget = pageTarget?"":""

prevPage = currentPage > 1 ? currentPage - 1 : 0,

nextPage = currentPage < allPage ? currentPage + 1 : 0

left = '<<&lt',

right = '>>>';

html.push('

');

html.push(left);

for(var i=currentPage; i<=allPage; i++) {

html.push(''+i+'');

}

html.push(right);

html.push('

');

self.html(html.join(''));

};

})();

$(document).ready(function(){

$('#pageContainer').pageCreate("http://localhost/?page=", 5, 3, '_blank');

});

更多关于jQuery特效相关内容感兴趣的读者可查看本站专题:《jQuery常见经典特效汇总》及《jQuery动画与特效用法总结》

希望本文所述对大家jQuery程序设计有所帮助。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值