Page title Flash effects (jquery and JavaScript)

Source: Internet
Author: User
Tags setinterval version xmlns

Article Introduction: the page title flashes the jquery version with the JavaScript version.

Domineering manifesto: page title flashing
Work Type: dynamic effect (Dynamic JS, jquery works)
Description: page title flashes jquery version with JavaScript version
jquery version

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">



<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>

<title> My Documents </title>

<script type= "Text/javascript" language= "JavaScript" src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js ">
<script type= "Text/javascript" language= "JavaScript" >

$ (document). Ready (function () {

Title_default = $ ("title"). Text ();

Show = "New Message" "+title_default;

none = "" "+title_default;

i = 0;

Flicker ();

})

function Flicker () {

SetInterval ("Change ()", 1000)

}

function Change () {

if (i==0) {

$ ("title"). Text (show)

i = 1;

}

else {

$ ("title"). Text (None)

i = 0;

}

}

</script>



<body>

</body>

JavaScript version

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">



<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>

<title> My Documents </title>

<script type= "Text/javascript" language= "JavaScript" >

Flicker ();

var title = document.getElementsByTagName ("title");

var title_txt = Title[0].firstchild.nodevalue;

var show = "New Message" "+title_txt;

var none = "" "+title_txt;

var i = 0;
< br/>
function Flicker () {

SetInterval ("Change ()", 1000)

}

function Change () {

if (i==0) {

Title[0].firstchild.nodevalue = Show;

i = 1;

}

else {

Title[0].firstchild.nodevalue = none;

i = 0;

}

}

</script>



<body>

</body>



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.