Switching javascript code for fade-in and fade-out text slides

Source: Internet
Author: User
Tip: you can modify some code before running

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Switching javascript code for fade-in and fade-out text slides</title><meta http-equiv="content-type" content="text/html;charset=gb2312"><!--把下面代码加到<head>与</head>之间--><style type="text/css"># Memoryticker {background-color: lightyellow; width: Pixel px; font: bold 12px Verdana;/* Tip: add in height attribute here for multiple line scroller */border: 1px solid black; padding: 3px;/* Change 0.7 below to a different number if desired (0.7 = 0.7 seconds) * // * Remove below line to remove transitional effect in IE. below line shoshould always appear last within this CSS */filter: progid: DXImageTransform. microsoft. gradientWipe (GradientSize = 1.0 Duration = 0.7 )}</style></head><body><!--把下面代码加到<body>与</body>之间--><script type="text/javascript">// Configure tickercontents [] to set the messges you wish be displayed (HTML codes accepted) // Backslash any apostrophes within your text (ie: I'm the king of the world !) Var tickercontents = new Array () tickercontents [0] = '1) webpage effects-JavaScript tutorials and scripts. 'tickercontents [1] = '2) webpage code-Web coding and development forums. 'tickercontents [2] = '3) special effect Garden-Award winning, original DHTML scripts. 'tickercontents [3] = '4) webpage creation-Free Java applets, tutorials, and resources. 'Var persistlastviewedmsg = 1 // shold messages order persist after users navigate away (1 = yes, 0 = no )? Var persistmsgbehavior = "onload" // set to "onload" or "onclick ". // configure the below variable to determine the delay between ticking of messages (in miliseconds ): var tickdelay = 3000 // Do not edit pass this linevar divonclick = (persistlastviewedmsg & persistmsgbehavior = "onclick ")? 'Onclick = "savelastmsg ()" ': ''var currentmessage = 0 function changetickercontent () {if (crosstick. filters & crosstick. filters. length> 0) crosstick. filters [0]. apply () crosstick. innerHTML = tickercontents [currentmessage] if (crosstick. filters & crosstick. filters. length> 0) crosstick. filters [0]. play () currentmessage = (currentmessage = tickercontents. length-1 )? Currentmessage = 0: currentmessage + 1var filterduration = (crosstick. filters & crosstick. filters. length> 0 )? Crosstick. filters [0]. duration * 1000: 0 setTimeout ("changetickercontent ()", tickdelay + filterduration)} function beginticker () {if (persistlastviewedmsg & get_cookie ("lastmsgnum ")! = "") Revivelastmsg () crosstick = document. getElementById? Document. getElementById ("memoryticker"): document. all. memorytickerchangetickercontent ()} function get_cookie (Name) {var search = Name + "=" var returnvalue = "" if (document. cookie. length> 0) {offset = document. cookie. indexOf (search) if (offset! =-1) {offset + = search. lengthend = document. cookie. indexOf (";", offset) if (end =-1) end = document. cookie. length; returnvalue = unescape (document. cookie. substring (offset, end)} return returnvalue;} function savelastmsg () {document. cookie = "lastmsgnum =" + currentmessage} function revivelastmsg () {currentmessage = parseInt (get_cookie ("lastmsgnum") currentmessage = (currentmessage = 0 )? Tickercontents. length-1: currentmessage-1} if (persistlastviewedmsg & persistmsgbehavior = "onload") window. onunload = savelastmsgif (document. all | document. getElementById) document. write ('<div id="memoryticker" '+divonclick+'></div>') If (window. addEventListener) window. addEventListener ("load", beginticker, false) else if (window. attachEvent) window. attachEvent ("onload", beginticker) else if (document. all | document. getElementById) window. onload = beginticker</script></body></html></td> </tr></table>
Tip: you can modify some code before running
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.