本文目录一览:
- 1、求个Discuz! X2横幅DIY图片广告代码
- 2、discuz游戏上下轮播代码,怎么弄
- 3、请问这个在discuz是怎么实现的呢?是插件吗?
- 4、discuz论坛如何更改滚动条
- 5、Discuz! X1.5 横幅图片怎么设置?
- 6、写日志如何加入动态横幅??
求个Discuz! X2横幅DIY图片广告代码
静态模块html语言:img src=".图片地址" width="960" height="100" alt="" /
tr
td valign="top"
div class="Contentnr auto"
style
#msg_weibo {width:300px;height:186px;*height:186px;_height:170px;margin:10px auto 0;zoom:1; overflow:hidden;font-size:12px;line-height:20px;margin-bottom:4px;background:#ffffff;}
#msg_weibo a{margin-right:6px;color:#003C71;text-decoration:none;}
#msg_weibo a:hover{color:#c00;text-decoration:underline;}
#msg_weibo img{margin-top:2px;}
#msg_weibo span{color: #888;}
#msg_weibo div{padding:8px 0 11px 0 ;overflow:hidden;zoom:1;background:url(/upload/201009/20100901004427526.gif) left bottom repeat-x}
#msg_weibo span a{display:block;}
#msg_weibo img{float:left;width:50px; height:50px; padding:2px; border:#D6D6D6 1px solid;}
#msg_weibo p{float:left;width:295px; padding-left:5px; }
/style
div id="msg_weibo"
div class="con"p
/p/div
div class="con"p
js文字向上滚动js文字向上滚动js文字向上滚动js文字向上滚动
/p/div
div class="con"p
男篮,加油
/p/div
div class="con"p昨天竞彩网让分胜负是希腊让中国20分!…中国打得不错!死了一大片彩民
/p/div
div class="con"p
有希望
/p/div
div class="con"p
晚上的比赛将是男篮在这届世锦赛的首胜。加油
/p/div
div class="con"p
今晚的中国男篮让我刮目相看了,也完全出乎我的意料!积极主动、神勇自信、信赖队友、坚持自己的打法、不慌张,这简直是一支梦幻的国家队,如果个人技术能再好一点,还真有世界强队的样子。能跟前欧洲冠军希腊队打成这样,真的很佩服,不得不竖大拇哥。易建联、王治郅,个个好样的!/p
/div
div class="con"p
a target="_blank"刘伟其实这场还行,只是手感不好,如果那两个投篮进了肯定又有特多人说他是好控位了,而且还会说是救了中国,所以不要总怪刘伟,还是因为中国整体实力和希腊比不了,不过这场打的挺好了,这么打下去我相信中国会出线的
/p/div
div class="con"p
鄙视那些自以为了不起的人,同样是中国人,你那么凶不去世锦赛上牛比?
/p/div
/div
/div
/td
/tr
/table
script language="javascript"
var $ = function (d){
typeof d == "string" (d = document.getElementById(d));
return $.fn.call(d);
};
$.fn = function (){
this.addEvent = function (sEventType,fnHandler){
if (this.addEventListener) {this.addEventListener(sEventType, fnHandler, false);}
else if (this.attachEvent) {this.attachEvent("on" + sEventType, fnHandler);}
else {this["on" + sEventType] = fnHandler;}
}
this.removeEvent = function (sEventType,fnHandler){
if (this.removeEventListener) {this.removeEventListener(sEventType, fnHandler, false);}
else if (this.detachEvent) {this.detachEvent("on" + sEventType, fnHandler);}
else { this["on" + sEventType] = null;}
}
return this;
};
var Class = {create: function() {return function() { this.initialize.apply(this, arguments); }}};
var Bind = function (obj,fun,arr){return function() {return fun.apply(obj,arr);}}
var Marquee = Class.create();
Marquee.prototype = {
initialize: function(id,name,out,speed) {
this.name = name;
this.box = $(id);
this.out = 3;//滚动间隔时间,单位秒
this.speed = speed;
this.d = 1;
this.box.style.position = "relative";
this.box.scrollTop = 0;
var _li = this.box.firstChild;
while(typeof(_li.tagName)=="undefined")_li = _li.nextSibling;
this.lis = this.box.getElementsByTagName(_li.tagName);
this.len = this.lis.length;
for(var i=0;ithis.lis.length;i++){
var __li = document.createElement(_li.tagName);
__li.innerHTML = this.lis[i].innerHTML;
this.box.appendChild(__li);//cloneNode
if(this.lis[i].offsetTop=this.box.offsetHeight)break;
}
this.Start();
this.box.addEvent("mouseover",Bind(this,function(){clearTimeout(this.timeout);},[]));
this.box.addEvent("mouseout",Bind(this,this.Start,[]));
},
Start:function (){
clearTimeout(this.timeout);
this.timeout = setTimeout(this.name+".Up()",this.out*1000)
},
Up:function(){
clearInterval(this.interval);
this.interval = setInterval(this.name+".Fun()",10);
},
Fun:function (){
this.box.scrollTop+=this.speed;
if(this.lis[this.d].offsetTop = this.box.scrollTop){
clearInterval(this.interval);
this.box.scrollTop = this.lis[this.d].offsetTop;
this.Start();
this.d++;
}
if(this.d = this.len + 1){
this.d = 1;
this.box.scrollTop = 0;
}
}
};
$(window).addEvent("load",function (){
marquee = new Marquee("msg_weibo","marquee",1,2);
});
/script
/div
请问这个在discuz是怎么实现的呢?是插件吗?
就是一个javascript+css实现的功能
参考:
在页面中导入jquery.js和gobacktop.js就可以了,然后修改gobacktop.js中的图片路径,就可以使用了,一个不错的返回页面顶部的js,gobacktop.js是在网上找到的!
gobacktop.js的代码如下:
//** jQuery Scroll to Top Control script- (c) Dynamic Drive DHTML code library: .
//** Available/ usage terms at (March 30th, 09')
//** v1.1 (April 7th, 09'):
//** 1) Adds ability to scroll to an absolute position (from top of page) or specific element on the page instead.
//** 2) Fixes scroll animation not working in Opera.
var scrolltotop={
//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
setting: {startline:1, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
controlHTML: 'img src="../images/top.png" style="width:39px; height:16px" /', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
controlattrs: {offsetx:100, offsety:80}, //offset of control relative to right/ bottom of window corner
anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
state: {isvisible:false, shouldvisible:false},
scrollup:function(){
if (!this.cssfixedsupport) //if control is positioned using JavaScript
this.$control.css({opacity:0}) //hide control immediately after clicking it
var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
if (typeof dest=="string" jQuery('#'+dest).length==1) //check element set by string exists
dest=jQuery('#'+dest).offset().top
else
dest=0
this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
},
keepfixed:function(){
var $window=jQuery(window)
var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
this.$control.css({left:controlx+'px', top:controly+'px'})
},
togglecontrol:function(){
var scrolltop=jQuery(window).scrollTop()
if (!this.cssfixedsupport)
this.keepfixed()
this.state.shouldvisible=(scrolltop=this.setting.startline)? true : false
if (this.state.shouldvisible !this.state.isvisible){
this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
this.state.isvisible=true
}
else if (this.state.shouldvisible==false this.state.isvisible){
this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
this.state.isvisible=false
}
},
init:function(){
jQuery(document).ready(function($){
var mainobj=scrolltotop
var iebrws=document.all
mainobj.cssfixedsupport=!iebrws || iebrws document.compatMode=="CSS1Compat" window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
mainobj.$control=$('div id="topcontrol"'+mainobj.controlHTML+'/div')
.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
.attr({title:'Scroll Back to Top'})
.click(function(){mainobj.scrollup(); return false})
.appendTo('body')
if (document.all !window.XMLHttpRequest mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
mainobj.togglecontrol()
$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
mainobj.scrollup()
return false
})
$(window).bind('scroll resize', function(e){
mainobj.togglecontrol()
})
})
}
}
scrolltotop.init()
setting: {startline:1, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
startline: 鼠标向下滚动了100px后出现#topcontrol*/scrollto: 它的值可以是整数,也可以是一个id标记。若为整数(假设为n),则滑动到距离top的n像素处;若为id标记,则滑动到该id标记所在的同等高处scrollduration:滑动的速度fadeduration:#topcontrol这个div的淡入淡出速度,第一个参数为淡入速度,第二个参数为淡出速度
controlHTML: '',
controlHTML:控制向上滑动的,直接插入引动的图片,可以手动设置style。该处的html代码会被包含在一个id标记为#topcontrol的div中。
controlattrs: {offsetx:100, offsety:80},
controlattrs:控制#topcontrol这个div距离右下角的像素距离
anchorkeyword: '#top',
state: {isvisible:false, shouldvisible:false},
state: isvisible:是否#topcontrol这个div为可见
shouldvisible:是否#topcontrol这个div该出现
discuz论坛如何更改滚动条
::-webkit-scrollbar{height:16px;overflow:visible;width:16px}
::-webkit-scrollbar-button{height:0;width:0}
::-webkit-scrollbar-track{box-shadow:inset 1px 1px 0 rgba(0,0,0,.14),inset -1px -1px 0 rgba(0,0,0,.07)}
::-webkit-scrollbar-track:hover{background-color:rgba(0,0,0,.05)}
::-webkit-scrollbar-track:active{background-color:rgba(0,0,0,.05);box-shadow:inset 1px -1px 0 rgba(0,0,0,.14),inset -1px 1px 0 rgba(0,0,0,.07)}
::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2);min-height:28px;}
::-webkit-scrollbar-thumb:hover{background-color:rgba(0,0,0,.4);box-shadow:inset 1px 1px 1px rgba(0,0,0,.25)}
::-webkit-scrollbar-thumb:active{background-color:rgba(0,0,0,0.5);}
::-webkit-scrollbar-corner{background:transparent}
以上代码加入到你正在用的模板文件里面的/common/extend_common.css里。没有就新建一个。只支持Chrome和Safari等webkit浏览器。其余一概不支持
Discuz! X1.5 横幅图片怎么设置?
管理员登录,直接DIY就行了,先添加个100%的框架,再添加个静态模块,自由填写代码。
加入下面代码。
里面的图片地址,和链接地址,自己修改。
div style="margin:5px;"embed class=a type=application/x-shockwave-flash src= wmode="opaque"/embed/div
div style="margin:5px;"a href="thread-799300-1-1.html" target="_blank"img src="" width=950 height=80/a/div
div style="margin:5px;"a href="thread-799300-1-1.html" target="_blank"img src="" width=950 height=100/a/div
div style="margin:5px;"a href="thread-799300-1-1.html" target="_blank"img src="" width=950 height=100/a/div