- 積分
- 406
- 威望
- 406
- 金錢
- 398
- 最後登錄
- 2014-5-28
|
工具 » 數據調用
添加主題列表
版塊名稱:熱門圖片
顯示數據條數: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>
複製代碼 分類間廣告加入以下代碼有空再PO:
鼠標靠近鏈接~彈出縮略圖功能
圖片列表的縮略圖帶箭頭形狀像視頻列表的代碼
打完收工! |
|