码迷,mamicode.com
首页 > Web开发 > 详细

【HTML】 向网页<Title></Title>中插入图片以及跑马灯

时间:2017-06-19 01:18:29      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:var   html   ges   interval   pre   效果   val   插入   图片   

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
</style>
<title> 欢迎来到我的主页界面</title>
<!--引入图片-->
<link href="images/titleIcon.ico" rel="SHORTCUT ICON" />

<!--在标题中实现跑马灯的效果-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(function(){
    var title=$("title").html();
    var temptitle=title;
    var length=title.length;
    setInterval(function(){
        temptitle=temptitle.concat(temptitle.charAt(0));
        length=temptitle.length;
        temptitle=temptitle.substring(1,length);
        $("title").html(temptitle);
    }, 500);
    
});
</script>
</head>
<body>

</body>
</html>

【HTML】 向网页<Title></Title>中插入图片以及跑马灯

标签:var   html   ges   interval   pre   效果   val   插入   图片   

原文地址:http://www.cnblogs.com/amag/p/7046005.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!