木子天龙 发表于 2010-7-1 01:06

俺想学习学习 谢谢

weijie123 发表于 2010-7-24 17:35

俺想看看学学,谢谢老师!

把酒横箫 发表于 2010-9-2 11:39

漂亮滴,学习一下
<html>
<head>
<title>
变幻多姿的文字公告牌
</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">
<xml:namespace ns=\"urn:schemas-microsoft-com:vml\" prefix=\"v\"/>
<style>
v\\:* { behavior: url(#default#VML); }
</style>

</head>

<BODY>

<table width=400 height=200 border=0 cellpadding=0 cellspacing=0>
<tr><td>
<SCRIPT>

var text=new Array()
var textlink=new Array()
var texttarget=new Array()

/////////////////////////////////////////////////////////////////////
// EDITZONE STARTS HERE
////////////////////////////////////////////////////////////////////

// Add your messages. They should be rather short.
// They should have the same length more or less.
text=\"谢谢楼主啦\"
text=\"谢谢楼主啦\"
text=\"莺燕音画 \"
text=\"莺燕音画 \"
text=\"莺燕音画 \"
text=\"莺燕音画 \"
text=\"莺燕音画 \"
text=\"莺燕音画 \"


// Add a link for each message
// If you don\'t want to link a message enter \"#\" instead (see sample below)
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"
textlink=\"http://www.yinhuabbs.cn/space.php?uid=2893\"


// Add a target-window for each link
// Possible values: \"_blank\",\"_top\", \"_self\", \"_parent\" or the name of a frame
texttarget=\"_blank\"
texttarget=\"_blank\"
texttarget=\"_blank\"
texttarget=\"_blank\"
texttarget=\"_blank\"
texttarget=\"_top\"
texttarget=\"_parent\"
texttarget=\"_self\"


// Set the font
var textfont=\"微软雅黑\"

// Add as many font-colors as you like
var textfontcolor=new Array(\"#FF0000\",\"#0000FF\",\"#00FF00\",\"#660000\")

// Add as many font-outline-colors as you like
var outlinecolor=new Array(\"#000000\",\"#000000\",\"#FDCF15\")

// Add as many font-shadow-colors as you like
var shadowcolor=new Array(\"#FFFF00\",\"#00FFFF\",\"#FDCF15\")

// Set the font-rollovercolor (required for Netscape and Opera only)
var textfontcolorrollover=\"#ff0000\"

// Set the font-size (required for Netscape and Opera only)
var textfontsize=20

// Set the background-color
var textbgcolor=\"#000000\"

// Set \"bold\" or \"normal\" (required for Netscape and Opera only)
var textweight=\"normal\"

// Set \"italic\" or \"normal\" (required for Netscape and Opera only)rsiv sein soll
var textitalic=\"normal\"

// Set width and height of your Fun Ticker (pixels)
// IMPORTANT: width and height must also be set in the table (see top of code)
var textwidth=400
var textheight=200

// Set the delay between the messages (seconds)
var textpause=2

// Set the width of the funticker\'s border (pixels)
var funtickerborder=3

// Set the color of the funticker\'s border
var funtickerbordercolor=\"#FDCF15\"

// Set the width of the font-outline (pixels)
var widthfontoutline=1

// Set the strength of the font\'s opacity (transparency of letters)
var fontopacity=\"50%\"

// Set the strength of the shadow\'s opacity (transparency of shadow)
var shadowopacity=\"50%\"

// Set true if your font should display a gradient effect
// Set false if your font should display NO gradient effect
var applygradient=true

// Enter a value between 0 and 3 to set the shape for your messages
// If you enter 4 all shapes will be applied
var i_shape=4

/////////////////////////////////////////////////////////////////////
// EDITZONE ENDS HERE
///////////////////////////////////////////////////////////////////

var path=new Array()
path=\"m20 0c300 140,300 50,580, 0m20 300c400 100,300 250,580 300e\"
path=\"m20 100c300 -50,300 50,580, 100m20 200c300 400,300 300,580 200e\"
path=\"m20 120c300 100,300 50,580, 0m20 180c300 180,300 300,580 300e\"
path=\"m20 0c300 140,300 50,580, 0m150 300c400 100,300 250,450 300e\"

var i_path=0
var speed=60
var textdecoration=\"none\"

var innerwidth=Math.floor(0.90*textwidth)
var innerheight=Math.floor(0.90*textheight)

var posleft=Math.floor((textwidth-innerwidth)/2-funtickerborder)
var postop=Math.floor((textheight-innerheight)/2)

var i_message=0
var i_messagelength=0
var i_outlinecolor=0
var i_textfontcolor=0
var i_shadowcolor=0

var textalign=\"center\"
var textvalign=\"middle\"
var textitalicA=\"\"
var textitalicB=\"\"
var textweightA=\"\"
var textweightB=\"\"
var textfontsizeHTML=1
var i_mes=0

var i_substring=0
var i_presubstring=0
var i_text=0
var textcontent=\"\"
var notag=true
var textpresubstring=\"\"
var textaftersubstring=\"\"
textpause*=1000

var browserinfos=navigator.userAgent
var ie4=!document.getElementById&&document.all&&!browserinfos.match(/Opera/)
var ie5=document.getElementById&&document.all&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/)
var opera=browserinfos.match(/Opera/)

function gettextcontent() {
tablewidth=textwidth-2*funtickerborder
tableheight=textheight-2*funtickerborder
textpresubstring=text.substring(0,i_presubstring)
var i_prepre=i_presubstring-1
if (i_prepre<0) {i_prepre=0}
if (text.substring(i_prepre,i_presubstring)==\"<\"){notag=false}
if (text.substring(i_prepre,i_presubstring)==\">\"){notag=true}
if (notag) {
textcontent=\"<table border=0 cellpadding=4 width=\"+tablewidth+\" height=\"+tableheight+\"><tr valign=\"+textvalign+\"><td align=\"+textalign+\">\"
textcontent+=\"<a href=\'\"+textlink+\"\' target=\'\"+texttarget+\"\' style=\'position:relative; font-family:\"+textfont+\";text-decoration:\"+textdecoration+\";font-family:\"+textfont+\";color:\"+textfontcolor+\";font-size:\"+textfontsize+\"pt;font-weight:\"+textweight+\";font-style:\"+textitalic+\"\' onMouseOver=\\\"this.style.color=\\\'\"+textfontcolorrollover+\"\\\'\\\" onMouseOut=\\\"this.style.color=\\\'\"+textfontcolor+\"\\\'\\\">\"
textcontent+=textpresubstring
textcontent+=\"</a>\"
textcontent+=\"</td></tr></table>\"
}
}

function showtickerNS6() {
textcontent=\"<table border=0 cellpadding=4 width=\"+textwidth+\" height=\"+textheight+\"><tr valign=\"+textvalign+\"><td align=\"+textalign+\">\"
textcontent+=\"<a href=\'\"+textlink+\"\' target=\'\"+texttarget+\"\' style=\'position:relative; font-family:\"+textfont+\";text-decoration:\"+textdecoration+\";font-family:\"+textfont+\";color:\"+textfontcolor+\";font-size:\"+textfontsize+\"pt;font-weight:\"+textweight+\";font-style:\"+textitalic+\"\' onMouseOver=\\\"this.style.color=\\\'\"+textfontcolorrollover+\"\\\'\\\" onMouseOut=\\\"this.style.color=\\\'\"+textfontcolor+\"\\\'\\\">\"
textcontent+=text
textcontent+=\"</a>\"
textcontent+=\"</td></tr></table>\"
document.getElementById(\"ticker\").innerHTML=textcontent
i_text++
i_textfontcolor++
if (i_text>=text.length) {i_text=0}
if (i_textfontcolor>=textfontcolor.length-1) {i_textfontcolor=0}
var timer=setTimeout(\"showtickerNS6()\", textpause)
}

function showticker() {
if (i_substring<=text.length) {
   i_substring++
   i_presubstring=i_substring-1
   if (i_presubstring<0) {i_presubstring=0}
   gettextcontent()
if (opera) {
   document.getElementById(\"ticker\").innerHTML=textcontent
   var timer=setTimeout(\"showticker()\", speed)
}
}
else {
clearTimeout(timer)
var timer=setTimeout(\"changetext()\", textpause)
}
}

function changetext() {
i_substring=0
i_presubstring=0
i_text++
i_textfontcolor++
i_path++
if (i_text>text.length-1) {i_text=0}
if (i_textfontcolor>textfontcolor.length-1) {i_textfontcolor=0}
showticker()
}

function changeform() {
if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}
if (i_textfontcolor >= textfontcolor.length) {i_textfontcolor=0}
if (i_shadowcolor >= shadowcolor.length) {i_shadowcolor=0}
if (i_path>path.length-1) {i_path=0}
document.getElementById(\'strokeid\').color=outlinecolor
document.getElementById(\'fillid\').color=textfontcolor
document.getElementById(\'shadowid\').color=shadowcolor
if (i_shape==path.length) {
document.getElementById(\'shapeid\').path=path
}
if (i_message < text.length) {
tick()
}
else {i_message=0;tick()}
}

function tick() {
if (i_messagelength <= text.length) {

var messagestringend=\"\"
var messagestring=text.substring(0, i_messagelength)+messagestringend
document.getElementById(\'textpathid\').string=messagestring
var timer=setTimeout(\"tick()\",speed)
i_messagelength++
}
else {
clearTimeout(timer)
var timer=setTimeout(\"prechangeform()\",textpause)
}
}

function prechangeform() {
i_messagelength=0
i_message++
i_outlinecolor++
i_textfontcolor++
i_shadowcolor++
i_path++
changeform()
}

function openlink() {
if (texttarget==\"_blank\") {
codepopup=window.open(textlink, \"code\", \"status=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes,width=770,height=460,top=10,left=10\");
}
else if (texttarget==\"_top\") {
top.location.href=textlink
}
else if (texttarget==\"_parent\") {
parent.location.href=textlink
}
else if (texttarget==\"_self\") {
document.location.href=textlink
}
else {
var jumpto=eval(\"parent.\"+texttarget)
jumpto.location.href=textlink
}
}

if (ie5) {
document.write(\'<div ID=\"roof\" style=\"position:relative;width:\'+textwidth+\'px;height:\'+textheight+\'px;border-style:solid;border-width:\'+funtickerborder+\'px;border-color:\'+funtickerbordercolor+\';background-color:\'+textbgcolor+\';cursor:hand\" onClick=\"openlink()\">\')
document.write(\'<v:shapetype id=\"shapeid\" coordsize=\"600,320\" path=\"\'+path+\'\">\')
document.write(\'<v:path textpathok=\"t\"/>\')
document.write(\'<v:textpath on=\"t\" fitshape=\"t\" xscale=\"t\"/>\')
document.write(\'</v:shapetype>\')
document.write(\'<v:shape type=\"#shapeid\" style=\"position:absolute; top:3px; left:\'+posleft+\'px; width:\'+innerwidth+\'px;height:\'+innerheight+\'px;\" strokeweight=\"1pt\">\')
if (applygradient) {
document.write(\'<v:fill id=\"fillid\" method=\"linear sigma\" type=\"gradient\" color=\"\'+textfontcolor+\'\" opacity=\"\'+fontopacity+\'\"/>\')
}
else {
document.write(\'<v:fill id=\"fillid\" color=\"\'+textfontcolor+\'\" opacity=\"\'+fontopacity+\'\"/>\')
}
document.write(\'<v:stroke id=\"strokeid\" weight=\"\'+widthfontoutline+\'pt\" color=\"\'+outlinecolor+\'\"/>\')

document.write(\'<v:shadow on=\"t\" id=\"shadowid\" opacity=\"\'+shadowopacity+\'\" color=\"\'+shadowcolor+\'\"/>\')
document.write(\'<v:textpath id=\"textpathid\" style=\"font-family:\\\'\'+textfont+\'\\\';v-text-kern:t\" trim=\"t\" fitpath=\"t\" xscale=\"f\" string=\"Hello World\"/>\')

document.write(\'</v:shape>\')
document.write(\'</div>\')
}


if (ns6 || opera) {
if (ns6) {
textwidth-=2*funtickerborder
textheight-=2*funtickerborder
}
document.write(\'<div ID=\"roof\" style=\"position:relative;width:\'+textwidth+\'px;height:\'+textheight+\'px;border-style:solid;border-width:\'+funtickerborder+\'px;border-color:\'+funtickerbordercolor+\';background-color:\'+textbgcolor+\'\">\')
document.write(\'<span ID=\"ticker\" style=\"position:absolute;top:0px;left:0px;width:\'+innerwidth+\'px;height:\'+innerheight+\'px;\"></span>\')
document.write(\'</div>\')
}

if (ie5) {window.onload=changeform}
if (opera) {window.onload=showticker}
if (ns6) {window.onload=showtickerNS6}
</script>
</td></tr></table>


</body>
</html>

[ 本帖最后由 把酒横箫 于 2010-9-2 11:48 编辑 ]

yijia 发表于 2010-9-22 13:17

不错啊。。。。。。。。。我喜欢

一狼 发表于 2010-9-22 21:19

ccccccccccc

lzwlhbb 发表于 2010-10-26 14:01

认真学习 虚心求教 呵呵

网上清风 发表于 2010-11-13 22:02

谢谢分享,学习!

lsr2004 发表于 2010-11-23 08:53

认真学习 虚心求教

牌楼大王 发表于 2011-6-6 15:40

学习中~~~~~~~~~~~

独舞千年 发表于 2011-6-8 15:23

来看看效果哈
页: 1 2 [3] 4 5
查看完整版本: 多姿的文字广告效果