繁體
|
簡體
Sclub交友聊天~加入聊天室當版主
(檢舉)
分享
新浪微博
QQ空间
人人网
腾讯微博
Facebook
Google+
Plurk
Twitter
Line
標題:
[分享]
熱圖排行榜代碼
[打印本頁]
作者:
n7197
時間:
2012-4-26 21:16
標題:
熱圖排行榜代碼
下載
(23.47 KB)
2012-4-26 20:59
工具 » 數據調用
添加主題列表
版塊名稱:熱門圖片
顯示數據條數:24
標題最大字節數:32
1680小時內瀏覽次數倒序排序
<script type="text/javascript">
var moveing = false;
function $(id) { return document.getElementById(id); }
function moveElement(elementID,final_x,final_y,interval) {
if (!document.getElementById) return false;
if (!document.getElementById(elementID)) return false;
var elem = document.getElementById(elementID);
if (elem.movement) {
clearTimeout(elem.movement);
}
if (!elem.style.left) {
elem.style.left = "0px";
}
if (!elem.style.top) {
elem.style.top = "0px";
}
var xpos = parseInt(elem.style.left);
var ypos = parseInt(elem.style.top);
if (xpos == final_x && ypos == final_y) {
moveing=false;
return true;
}
if (xpos < final_x) {
var dist = Math.ceil((final_x - xpos)/10);//Math.ceil求最小的整數,但不小於本身
xpos = xpos + dist;
}
if (xpos > final_x) {
var dist = Math.ceil((xpos - final_x)/10);
xpos = xpos - dist;
}
if (ypos < final_y) {
var dist = Math.ceil((final_y - ypos)/10);
ypos = ypos + dist;
}
if (ypos > final_y) {
var dist = Math.ceil((ypos - final_y)/10);
ypos = ypos - dist;
}
elem.style.left = xpos + "px";
elem.style.top = ypos + "px";
var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
elem.movement = setTimeout(repeat,interval);
}
function next(previousBtn,nextBtn,scrollID,highlightID) {
if(moveing) return;
moveing = true;
var vTop = parseInt($(scrollID).style.top);
var vLeft = parseInt($(scrollID).style.left);
if (vLeft <= -2073) return moveing=false;
if(vLeft == -1876) {
$(nextBtn).className = 'last_btn';
}
var finalLeft = vLeft - 938;
moveElement(scrollID,finalLeft,vTop,5);
$(previousBtn).className = 'previous';
var highLightList = $(highlightID).getElementsByTagName('span');
for (var i=0; i<highLightList.length; i++) {
if (highLightList[i].className == 'current') {
var currentNum = i;
}
}
highLightList[currentNum].className = '';
highLightList[currentNum+1].className = 'current';
}
function previous(previousBtn,nextBtn,scrollID,highlightID) {
if(moveing) return;
moveing = true;
var vTop = parseInt($(scrollID).style.top);
var vLeft = parseInt($(scrollID).style.left);
if (vLeft >= 0) return moveing=false;
if(vLeft == -938) {
$(previousBtn).className = 'first_btn';
}
var finalLeft = vLeft + 938;
moveElement(scrollID,finalLeft,vTop,5);
$(nextBtn).className = 'next';
var highLightList = $(highlightID).getElementsByTagName('span');
for (var i=0; i<highLightList.length; i++) {
if (highLightList[i].className == 'current') {
var currentNum = i;
}
}
highLightList[currentNum].className = '';
highLightList[currentNum-1].className = 'current';
}
</script>
<div id="NO5_picshow_b" style=" position:absolute; left:-999px; top:-999px;"><!--把下面代碼加到<body>與</body>之間-->
<div class="v">
<div class="v_caption">
<h2 class="cartoon" title="熱帖排行"><a href="javascript:void(0);" ><font color=red>熱門圖片熱度排行榜</font></a><sup> </sup></h2>
<div id="cartoon_highlight" class="highlight_tip"><span class="current">1</span><span>2</span><span>3</span><span>4</span></div>
<div class="change_btn"><span id="cartoon_previous_btn" class="first_btn" onclick="previous('cartoon_previous_btn','cartoon_next_btn','cartoon_list','cartoon_highlight')">上一页</span><span id="cartoon_next_btn" class="next" onclick="next('cartoon_previous_btn','cartoon_next_btn','cartoon_list','cartoon_highlight')">下一页</span></div>
<div class="right mintip"><a href="http://szpne.5d6d.com/forum-25.html"><font color=indigo> 更多實用代码>></font> </a></div>
</div>
<div class="v_content">
<div id="cartoon_list" class="v_content_list" style="top:0px; left:0px;">
<ul>
[node]<li><div class="jz_i">
<a href="{link}" title="{message}"><img src="{imgattach}" alt="標題:{subject_full}
作者:{author_nolink}
簡介:{message}
回帖:{lastposter_nolink}
回覆:{replies}
熱度:{views}
發布時間:{dateline}
最後回覆:{lastpost}
" /></a></div><h4>{subject}</h4><span><font color=red>熱度: </font><em>{views}</em></span></li>[/node]
</ul>
</div>
</div>
</div></div>
<script>QInd($("NO5_picshow_t"),$("NO5_picshow_b"));</script>
複製代碼
分類間廣告加入以下代碼
<style type="text/css">
/* 熱帖排行榜設置*/
.v {
width:950px;
margin:0px 0 1px 0px;
}
.v_caption {
height:35px;
border:#e7e7e7 1px solid;
position:relative;
z-index:1;
}
.v_caption h2 {
float:left;
width:110px;
height:35px;
overflow:hidden;
background:url(http://www.torfor.com/adcode.gif) no-repeat;
line-height:34px;
padding-left:5px;
}
.v_caption .cartoon {
background-position:0 -100px;
}
.v_caption .variety {
background-position:-100px -100px;
}
.highlight_tip {
display:inline;
float:left;
margin:14px 0 0 10px;
}
.highlight_tip span {
display:inline;
float:left;
width:7px;
height:7px;
overflow:hidden;
margin:0 2px;
background:url(http://mm.a.5d6d.com/userdirs/0/1/dieyu/attachments/month_1011/101127000455b5c0a15ddd7d47.gif) no-repeat 0 -320px;
text-indent:-9999px;
}
.highlight_tip .current {
background-position:0 -220px;
}
.change_btn {
float:left;
margin:7px 0 0 10px;
}
.change_btn span {
display:block;
float:left;
width:30px;
height:23px;
overflow:hidden;
background:url(http://mm.a.5d6d.com/userdirs/0/1/dieyu/attachments/month_1011/101127000455b5c0a15ddd7d47.gif) no-repeat;
text-indent:-9999px;
cursor:pointer;
}
.change_btn .previous {
background-position:0 -400px;
}
.change_btn .next {
width:31px;
background-position:-30px -400px;
}
.change_btn .first_btn {
background-position:0 -500px;
cursor:default;
}
.change_btn .last_btn {
background-position:-30px -500px;
cursor:default;
}
.v_caption em {
display:inline;
float:right;
margin:10px 12px 0 0;
font-family:simsun;
}
.v_content {
position:relative;
width:938px;
height:180px;
overflow:hidden;
border-right:1px solid #E7E7E7;
border-bottom:1px solid #E7E7E7;
border-left:1px solid #E7E7E7;
background:#fff;
}
.v_content_list {
position:absolute;
width:3750px;
}
.v_content ul {
}.v_content ul li {
display:inline;
float:left;
margin:10px 6px 0;
padding:8px;
background:url(http://mm.a.5d6d.com/userdirs/0/1/dieyu/attachments/month_1011/101127000198a2667691323b21.gif) no-repeat;
overflow:hidden;
}
.v_content ul li a {
width:128px;
height:80px;
text-align:center;
overflow:hidden;
}
.v_content ul li img {
min-width:128px;
_width:128px;
height:80px;
*height:100%;
_height:100px;
}
.v_content ul li h4 {
width:128px;
height:36px;
overflow:hidden;
margin-top:12px;
font-weight:normal;
}
.v_content ul li h4 a {
display:inline !important;
height:auto !important;
}
.v_content ul li span {
color:#666;
}
.v_content ul li em {
color:#888;
font-family:Verdana;
font-size:0.9em;
}
.jz_i {
max-width:128px;
_width:128px;
height:80px;
overflow:hidden;
display:table-cell;
*font-size:65px;
vertical-align:middle;
text-align:center;
}
.jz_i img {
vertical-align:middle;
}</style>
<div id="NO5_picshow_t"></div>
複製代碼
有空再PO:
鼠標靠近鏈接~彈出縮略圖功能
圖片列表的縮略圖帶箭頭形狀像視頻列表的代碼
打完收工!
圖片附件:
sshot-1.jpg
(2012-4-26 20:59, 23.47 KB) / 下載次數 1653
http://youpost.info/discuz/attachment.php?aid=2382&k=feb3ca03411f9fbf014578405f7d9e86&t=1732374793&sid=9z8TYK
作者:
8301853
時間:
2012-4-28 09:40
这个不错....支持
作者:
sojh
時間:
2012-9-15 16:15
顶!
作者:
gogo1266
時間:
2012-9-15 16:18
謝謝分享
作者:
liangweisee
時間:
2012-11-14 23:55
谢谢分享!
作者:
xqingt
時間:
2012-11-15 10:21
謝謝分享~~
作者:
4rphotoclub
時間:
2012-11-15 10:31
謝謝樓主分享這麼好的東西
作者:
章鱼
時間:
2012-11-15 16:17
这个好像是5D6D的打工者论坛原创的呢
歡迎光臨 SCLUB免費論壇申請-使用者論壇 (http://youpost.info/discuz/)
Powered by Discuz! 7.2