·设为首页收藏本站📧邮箱修改🎁免费下载专区💎积分✅卡密📒收藏夹👽聊天室
返回列表 发布新帖

Discuz X2 首页轮幻缩略图,焦点图,幻灯片,JS+css源码及安装使用教

1345 9
发表于 2020-7-8 10:12:58 | 查看全部 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
1.将下载的FLV文件夹上传到论坛使用的模板的根目录;
2.将在后台新建一个模块模板。命名为“门户首页百变幻灯片”;复制下列代码
  1. <div id="focus_change"><div id="focus_change_list" style="top:0; left:0;"><ul>[loop]<li><div class="img_item"><div><a href="{url}" target="_blank"><img src="{pic}"></a></div><div class="desc"><h5><a href="1.jpg" target="_blank">{title}</a></h5></div></div></li>[/loop]</ul></div><div class="focus_change_opacity"></div><div class="focus_change_opacity1"></div><div id="focus_change_btn"><ul>[loop]<li><a href="{url}"></a></li>[/loop]</ul></div></div>
复制代码
3.模块管理-数据调用-增加数据调用-模块分类(帖子模块)-模块标识 (门户首页百变幻灯片)-显示样式(门户首页百变幻灯片)

4.内部调用 将这样<!--{block/677}-->像似的代码放到你的首页幻灯片位置


5.并将以下代码放到<head>.....</head>之间;
  1. <script type="text/javascript">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) {return true;}if (xpos < final_x) {var dist = Math.ceil((final_x - xpos)/10);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 classNormal(){var focusBtnList = $('focus_change_btn').getElementsByTagName('li');for(var i=0; i<focusBtnList.length; i++) {focusBtnList[i].className='';}}function focusChange() {var focusBtnList = $('focus_change_btn').getElementsByTagName('li');focusBtnList[0].onmouseover = function() {moveElement('focus_change_list',0,0,5);classNormal()focusBtnList[0].className='current'}focusBtnList[1].onmouseover = function() {moveElement('focus_change_list',-320,0,5);classNormal()focusBtnList[1].className='current'}focusBtnList[2].onmouseover = function() {moveElement('focus_change_list',-640,0,5);classNormal()focusBtnList[2].className='current'}focusBtnList[3].onmouseover = function() {moveElement('focus_change_list',-960,0,5);classNormal()focusBtnList[3].className='current'}}setInterval('autoFocusChange()', 5000);var atuokey = false;function autoFocusChange() {$('focus_change').onmouseover = function(){atuokey = true}$('focus_change').onmouseout = function(){atuokey = false}if(atuokey) return;var focusBtnList = $('focus_change_btn').getElementsByTagName('li');for(var i=0; i<focusBtnList.length; i++) {if (focusBtnList[i].className == 'current') {var currentNum = i;}}if (currentNum==0 ){moveElement('focus_change_list',-320,0,5);classNormal()focusBtnList[1].className='current'}if (currentNum==1 ){moveElement('focus_change_list',-640,0,5);classNormal()focusBtnList[2].className='current'}if (currentNum==2 ){moveElement('focus_change_list',-960,0,5);classNormal()focusBtnList[3].className='current'} if (currentNum==3 ){moveElement('focus_change_list',0,0,5);classNormal()focusBtnList[0].className='current'}}function autoFocusChange() {$('focus_change').onmouseover = function(){atuokey = true}$('focus_change').onmouseout = function(){atuokey = false}if(atuokey) return;var focusBtnList = $('focus_change_btn').getElementsByTagName('li');for(var i=0; i<focusBtnList.length; i++) {if (focusBtnList[i].className == 'current') {var currentNum = i;}}if (currentNum==0 ){moveElement('focus_change_list',-320,0,5);classNormal()focusBtnList[1].className='current'focusBtnList[1].className='focus_change_btn1'}if (currentNum==1 ){moveElement('focus_change_list',-640,0,5);classNormal()focusBtnList[2].className='current'}if (currentNum==2 ){moveElement('focus_change_list',-960,0,5);classNormal()focusBtnList[3].className='current'} if (currentNum==3 ){moveElement('focus_change_list',0,0,5);classNormal()focusBtnList[0].className='current'}}</script><style type="text/css">/* Reset style */* { margin:0; padding:0; word-break:break-all; }body { background:#FFF; color:#333; font:12px/1.6em Helvetica, Arial, sans-serif; }h1, h2, h3, h4, h5, h6 { font-size:1em; }a { color:#039; text-decoration:none; }a:hover { text-decoration:underline; }ul, li { list-style:none; }fieldset, img { border:none; }em, strong, cite, th { font-style:normal; font-weight:normal; }/* Focus_change style */#focus_change { position:relative; width:320px; height:400px; overflow:hidden; margin:20px 0 1px 60px; }#focus_change_list { position:absolute; width:1800px; height:330px; }#focus_change_list li { float:left; }#focus_change_list li img { width:320px; height:330px; }.focus_change_opacity { position:absolute; width:320px; height:80px; top:330px; left:0; background:#000; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5; }.focus_change_opacity1 { position:absolute; width:320px; height:30px; top:290px; left:0; background:#000; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5; }#focus_change_btn { position:absolute; width:320px; height:65px; top:318px;}#focus_change_btn ul { padding-left:3px; }#focus_change_btn li { display:inline; float:left; margin:0 1px; padding-top:12px; }#focus_change_btn li a img { width:72px; height:65px; border:2px solid #888; }#focus_change_btn li a img span{ float:left; padding-top:12px;}#focus_change_btn .current { background:url(6C164133877.gif) no-repeat 37px 8px;}#focus_change_btn .current img { border-color:#EEE; }.img_item{float:left;width:320px;position:relative;}.img_item img{ width:320px; height:330px; } .desc{z-index:10; float:left;width:320px;color:#fff;position:absolute;top:295px;}.desc a{color:#fff;}.desc H5{font-SIZE:18px; padding-left:10px} </style>
复制代码
附件下载:
我要说一句 收起回复
一花一世界,一叶一追寻。一曲一场叹,一生为一人。
创宇盾启航版免费网站防御网站加速服务

评论9

独家记忆Lv.8 发表于 2020-7-8 10:13:40 | 查看全部
演示呢 ?、、、、
我要说一句 收起回复
拾光Lv.8 发表于 2020-7-8 10:13:56 | 查看全部
支持!好东西,拿走了!
我要说一句 收起回复
拾光Lv.8 发表于 2020-7-8 10:14:06 | 查看全部
不错,我喜欢
我要说一句 收起回复
TyCodingLv.8 发表于 2020-7-8 10:14:32 | 查看全部
看道破 不错啊
我要说一句 收起回复
TyCodingLv.8 发表于 2020-7-8 10:15:27 | 查看全部
好东西,要下来看看
我要说一句 收起回复
独家记忆Lv.8 发表于 2020-7-8 10:16:22 | 查看全部
看一下啊,嘻嘻
我要说一句 收起回复
拾光Lv.8 发表于 2020-7-8 10:17:14 | 查看全部
真的有意思!
我要说一句 收起回复
CrystαlLv.8 发表于 2020-7-8 10:18:02 | 查看全部
顶顶更健康
我要说一句 收起回复
拾光Lv.8 发表于 2020-7-8 10:18:17 | 查看全部
不错,谢谢分享
我要说一句 收起回复

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

创宇盾启航版免费网站防御网站加速服务
投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 )|网站地图 知道创宇云防御

您的IP:18.219.214.127,GMT+8, 2024-12-22 01:05 , Processed in 0.275293 second(s), 126 queries , Gzip On, Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2024 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表