jquery xml解析

本文介绍了一个使用jQuery进行XML解析的示例项目。通过Ajax获取XML文件内容,并使用jQuery选择器遍历XML节点,实现省份及其下属城市的动态加载。具体包括从XML中读取省份名称填充到下拉列表,当省份发生变化时,再次请求XML并更新城市下拉列表。
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>   
  2. <html>   
  3. <head>   
  4. <title>jquery xml解析</title>   
  5. <script type="text/javascript" src="js/jquery-1.3.2.js"></script>   
  6. <script type="text/javascript">   
  7.     $(document).ready(   
  8.             function() {   
  9.                 $.ajax( {   
  10.                     url "xx.xml",   
  11.                     success function(xml) {   
  12.                         $(xml).find("province").each(function() {   
  13.                             var $(this).attr("name");//this->      
  14.                                 $("#DropProvince").append(   
  15.                                         "<option>" "</option>");   
  16.                             });   
  17.                     }   
  18.                 });   
  19.                 $("#DropProvince").change(   
  20.                         function() {   
  21.                             $("#sCity>option").remove();   
  22.                             var pname $("#DropProvince").val();   
  23.                             $.ajax( {   
  24.                                 url "xx.xml",   
  25.                                 success function(xml) {   
  26.                                     $(xml).find(   
  27.                                             "province[name='" pname   
  28.                                                     "']>city").each(   
  29.                                             function() {   
  30.                                                 $("#sCity").append(   
  31.                                                         "<option>"  
  32.                                                                 $(this)   
  33.                                                                         .text()   
  34.                                                                 "</option>");   
  35.                                             });   
  36.                                 }   
  37.                             });   
  38.                         });   
  39.             });   
  40. </script>   
  41. </head>   
  42. <body>   
  43. <form id="form1">   
  44. <div>   
  45.     <select id="DropProvince" style="width: 60px;">   
  46.         <option>请选择</option>   
  47.     </select>   
  48.     <select id="sCity" style="width: 60px;">   
  49.     </select>   
  50. </div>   
  51. </form>   
  52. </body>   
  53. </html>  
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<title>jquery xml解析</title>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
        $(document).ready(
                        function() {
                                $.ajax( {
                                        url : "xx.xml",
                                        success : function(xml) {
                                                $(xml).find("province").each(function() {
                                                        var t = $(this).attr("name");//this->   
                                                                $("#DropProvince").append(
                                                                                "<option>" + t + "</option>");
                                                        });
                                        }
                                });
                                $("#DropProvince").change(
                                                function() {
                                                        $("#sCity>option").remove();
                                                        var pname = $("#DropProvince").val();
                                                        $.ajax( {
                                                                url : "xx.xml",
                                                                success : function(xml) {
                                                                        $(xml).find(
                                                                                        "province[name='" + pname
                                                                                                        + "']>city").each(
                                                                                        function() {
                                                                                                $("#sCity").append(
                                                                                                                "<option>"
                                                                                                                                + $(this)
                                                                                                                                                .text()
                                                                                                                                + "</option>");
                                                                                        });
                                                                }
                                                        });
                                                });
                        });
</script>
</head>
<body>
<form id="form1">
<div>
        <select id="DropProvince" style="width: 60px;">
                <option>请选择</option>
        </select>
        <select id="sCity" style="width: 60px;">
        </select>
</div>
</form>
</body>
</html>


xx.xml
Java代码 复制代码  收藏代码jquery <wbr>xml解析
  1. <?xml version="1.0" encoding="utf-8" ?>     
  2. <provinces>     
  3.     <province name="湖北"    
  4.         <city>武汉</city>     
  5.         <city>黄石</city>     
  6.         <city>宜昌</city>     
  7.         <city>天门</city>     
  8.     </province>     
  9.     <province name="湖南"    
  10.         <city>邵阳</city>     
  11.         <city>长沙</city>     
  12.         <city>岳阳</city>     
  13.     </province>     
  14.     <province name="广东"    
  15.         <city>广州</city>     
  16.         <city>深圳</city>     
  17.     </province>     
  18. </provinces>  
&lt;!DOCTYPE html&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt; &lt;head&gt; &lt;title&gt;唯美 &lt;/title&gt; &lt;meta name=&quot;keywords&quot; content=&quot; &quot;&gt; &lt;meta name=&quot;description&quot; content=&quot; &quot;&gt; &lt;meta name=&quot;author&quot; content=&quot;www.&quot;&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/reset.css&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt; &lt;link rel=&quot;shortcut icon&quot; href=&quot;index/images/favicon.ico&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/jquery.fancybox-1.3.4.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style.css&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt; &lt;link href=&quot;css/prettyPhoto.css&quot; rel=&quot;stylesheet&quot; /&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.min.js&quot; &gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/content_switch.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.easing.1.3.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.mousewheel.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-ui.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/cScroll.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/jquery.cycle.all.latest.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/jquery.color.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/script.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;js/functions.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/prettyPhoto.js&quot;&gt;&lt;/script&gt; &lt;!--[if lt IE 9]&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;./js/html5.js&quot;&gt;&lt;/script&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;./css/ie.css&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt; &lt;![endif]--&gt; &lt;!--[if lt IE 8]&gt; &lt;div style=&#39; clear: both; text-align:center; position: relative;&#39;&gt; &lt;a href=&quot;http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode&quot;&gt;&lt;img src=&quot;http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg&quot; border=&quot;0&quot; height=&quot;42&quot; width=&quot;820&quot; alt=&quot;You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today.&quot; /&gt;&lt;/a&gt; &lt;/div&gt; &lt;![endif]--&gt; &lt;body onpaste=&quot;return false&quot; ondragstart=&quot;return false&quot; onmouseover=&quot;window.status=&#39;&#39;;return true&quot; oncopy=&quot;return false;&quot;&gt; &lt;frameset&gt; &lt;frame src=&quot;index.html&quot;&gt; &lt;/frameset&gt; &lt;script&gt; function stop(){ alert(&#39;宝贝,我爱你!&#39;); return false; } document.oncontextmenu=stop; &lt;/script&gt; &lt;body onselectstart=&quot;return false&quot; onpaste=&quot;return false&quot; oncopy=&quot;return false;&quot; oncut=&quot;return false;&quot; &gt; &lt;script&gt; function checkhtml5() { if ($.browser.msie &amp;&amp; parseInt($.browser.version, 10) &lt; 9) { document.body.innerHTML=&quot;&lt;div style=&#39; clear: both; text-align:center; position: relative; height: 50px; margin-top: 30px; padding: 20px; background-color: red; color: white; font-size:20px;&#39;&gt;你的浏览器非常落后,不支持 HTML5!&lt;br/&gt;请使用 Chrome 14+/IE 9+/Firefox 7+/Safari 4+ 其中任意一款浏览器访问此页面。&lt;/a&gt;&lt;/div&gt;&quot;; } } &lt;/script&gt; &lt;head&gt; &lt;style&gt; a.wb_sina { float:left; margin-top:20px; margin-left:15px; display:inline-block; padding:4px 10px; border-radius:3px; background-color:#e55345; background-image:-moz-linear-gradient(top,#e96249,#e03c40); background-image:-ms-linear-gradient(top,#e96249,#e03c40); background-image:-webkit-gradient(linear,0 0,0 100%,from(#e96249),to(#e03c40)); background-image:-webkit-linear-gradient(top,#e96249,#e03c40); background-image:-o-linear-gradient(top,#e96249,#e03c40); background-image:linear-gradient(top,#e96249,#e03c40); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=&#39;#e96249&#39;,endColorstr=&#39;#e03c40&#39;,GradientType=0); background-repeat:repeat-x; text-shadow:0 -1px 0 rgba(0,0,0,.5); border:1px solid #cf2b28; color:#fff!important; box-shadow:0 1px 0 rgba(255,255,255,.2) inset,0 1px 0 rgba(0,0,0,.2); } a.wb_sina:hover { background-image:-moz-linear-gradient(top,#e03c40,#e96249); background-image:-ms-linear-gradient(top,#e03c40,#e96249); background-image:-webkit-gradient(linear,0 0,0 100%,from(#e03c40),to(#e96249)); background-image:-webkit-linear-gradient(top,#e03c40,#e96249); background-image:-o-linear-gradient(top,#e03c40,#e96249); background-image:linear-gradient(top,#e03c40,#e96249); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=&#39;#e03c40&#39;,endColorstr=&#39;#e96249&#39;,GradientType=0); } a.wb_sina span { display:inline-block; vertical-align:-5px; margin-right:7px; height:20px; width:24px; background:url(./images/weibo.png) no-repeat; } a.wb_tencent { float:left; margin-top:20px; margin-left:15px; display:inline-block; padding:4px 10px; border-radius:3px; background-color:#0e7fcc; background-image:-moz-linear-gradient(top,#1288d4,#0771c1); background-image:-ms-linear-gradient(top,#1288d4,#0771c1); background-image:-webkit-gradient(linear,0 0,0 100%,from(#1288d4),to(#0771c1)); background-image:-webkit-linear-gradient(top,#1288d4,#0771c1); background-image:-o-linear-gradient(top,#1288d4,#0771c1); background-image:linear-gradient(top,#1288d4,#0771c1); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=&#39;#1288d4&#39;,endColorstr=&#39;#0771c1&#39;,GradientType=0); background-repeat:repeat-x; text-shadow:0 -1px 0 rgba(0,0,0,.5); border:1px solid #0D6EB8; color:#fff!important; box-shadow:0 1px 0 rgba(255,255,255,.2) inset,0 1px 0 rgba(0,0,0,.2); } a.wb_tencent:hover { background-color:#0e7fcc; background-image:-moz-linear-gradient(top,#0771c1,#1288d4); background-image:-ms-linear-gradient(top,#0771c1,#1288d4); background-image:-webkit-gradient(linear,0 0,0 100%,from(#0771c1),to(#1288d4)); background-image:-webkit-linear-gradient(top,#0771c1,#1288d4); background-image:-o-linear-gradient(top,#0771c1,#1288d4); background-image:linear-gradient(top,#0771c1,#1288d4); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=&#39;#0771c1&#39;,endColorstr=&#39;#1288d4&#39;,GradientType=0); } a.wb_tencent span { display:inline-block; vertical-align:-5px; margin-right:7px; height:20px; width:24px; background:url(./images/weibo.png) no-repeat 0 -20px; } #abox { position: fixed; _position: absolute; right: 15px; z-index: 99999999; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;body onLoad=&quot;checkhtml5()&quot;&gt; &lt;div id=&quot;abox&quot;&gt; &lt;/div&gt; &lt;div class=&quot;page_spinner&quot;&gt; &lt;div&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;over&quot;&gt; &lt;div class=&quot;centre&quot;&gt; &lt;div class=&quot;main&quot;&gt; &lt;!--header --&gt; &lt;header&gt; &lt;h1&gt;&lt;span id=&quot;logo&quot;&gt;&lt;img src=&quot;images/logo1.png&quot; alt=&quot;&quot; usemap=&quot;#logo&quot;&gt;&lt;/span&gt;&lt;/h1&gt; &lt;nav class=&quot;menu&quot;&gt; &lt;ul id=&quot;menu&quot;&gt; &lt;li id=&quot;nav1&quot;&gt;&lt;img src=&quot;images/nav1.png&quot; alt=&quot;&quot;&gt;&lt;span&gt;爱的宣誓&lt;/span&gt;&lt;/li&gt; &lt;li id=&quot;nav2&quot;&gt;&lt;img src=&quot;images/nav2.png&quot; alt=&quot;&quot;&gt;&lt;span&gt;恋爱历程&lt;/span&gt; &lt;/li&gt; &lt;li id=&quot;nav3&quot;&gt;&lt;img src=&quot;images/nav3.png&quot; alt=&quot;&quot;&gt;&lt;span&gt;絮叨絮叨&lt;/span&gt;&lt;/li&gt; &lt;li id=&quot;nav4&quot;&gt;&lt;img src=&quot;images/nav4.png&quot; alt=&quot;&quot;&gt;&lt;span&gt;祝福我们&lt;/span&gt;&lt;/li&gt; &lt;li id=&quot;nav5&quot;&gt;&lt;img src=&quot;images/nav5.png&quot; alt=&quot;&quot;&gt;&lt;span&gt;爱的映像&lt;/span&gt;&lt;/li&gt; &lt;li id=&quot;nav6&quot;&gt;&lt;img src=&quot;images/nav6.png&quot; alt=&quot;&quot;&gt;&lt;span&gt;时光沙漏&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;img src=&quot;images/spacer.gif&quot; alt=&quot;&quot; id=&quot;navigation&quot; usemap=&quot;#navigation&quot;&gt; &lt;map name=&quot;navigation&quot; class=&quot;navigation&quot;&gt; &lt;/map&gt; &lt;map name=&quot;logo&quot; class=&quot;map_logo&quot;&gt;&lt;/map&gt; &lt;/header&gt; &lt;!--header end--&gt; &lt;!--content --&gt; &lt;map name=&quot;back&quot; class=&quot;map_back&quot;&gt;&lt;/map&gt; &lt;article id=&quot;content&quot;&gt; &lt;ul&gt; &lt;li id=&quot;page_Home&quot;&gt; &lt;img src=&quot;images/bg_content.png&quot; alt=&quot;&quot; class=&quot;bg_cont&quot;&gt; &lt;span class=&quot;back&quot;&gt;&lt;img src=&quot;images/nav1.png&quot; alt=&quot;&quot; usemap=&quot;#back&quot;&gt;&lt;a href=&quot;index.html#close&quot;&gt;返回&lt;/a&gt;&lt;/span&gt; &lt;div class=&quot;pad&quot;&gt; &lt;h2&gt;爱的宣誓&lt;/h2&gt; 人物:浟佳 &amp; 宝贝&lt;br /&gt; 不在乎曾经拥有,只在乎天长地久。&lt;br /&gt; 爱,就要说出来!&lt;br /&gt; 再美好的回忆,也只是回忆;&lt;br /&gt; 再美丽的诺言,不到实现的那一刻,也只是一句空话。&lt;br/&gt; -- &lt;/div&gt; &lt;/li&gt; &lt;li id=&quot;page_About&quot;&gt; &lt;img src=&quot;images/bg_content.png&quot; alt=&quot;&quot; class=&quot;bg_cont&quot;&gt; &lt;span class=&quot;back&quot;&gt;&lt;img src=&quot;images/nav2.png&quot; alt=&quot;&quot; usemap=&quot;#back&quot;&gt;&lt;a href=&quot;index.html#close&quot;&gt;返回&lt;/a&gt;&lt;/span&gt; &lt;div class=&quot;pad&quot;&gt; &lt;h2&gt;恋爱历程&lt;/h2&gt; &lt;div class=&quot;relative&quot;&gt; &lt;div class=&quot;scroll&quot;&gt; &lt;span&gt;人物:浟佳 &amp; 宝贝&lt;/span&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;宝贝你还记得么?&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;XX年X月X日。&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;我们在xx相遇。&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;然后.........&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;过程.........&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;我爱你,我会一直陪在你身边&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp;不离不弃&lt;/p&gt; &lt;p&gt;&nbsp;&nbsp;&nbsp;&nbsp; - &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li id=&quot;page_Talk&quot;&gt; &lt;img src=&quot;images/bg_content.png&quot; alt=&quot;&quot; class=&quot;bg_cont&quot;&gt; &lt;span class=&quot;back&quot;&gt;&lt;img src=&quot;images/nav3.png&quot; alt=&quot;&quot; usemap=&quot;#back&quot;&gt;&lt;a href=&quot;index.html#close&quot;&gt;返回&lt;/a&gt;&lt;/span&gt; &lt;div class=&quot;pad&quot;&gt; &lt;h2&gt;絮叨絮叨&lt;/h2&gt; &lt;div class=&quot;relative&quot;&gt; &lt;div class=&quot;scroll&quot;&gt; &lt;div style=&quot;width:100%;float: left; border-bottom: 1px solid #CCCCCC;&quot;&gt;浟佳&lt;br/&gt;&lt;span style=&quot;float: right&quot;&gt; --by &lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;width:100%;float: left&quot;&gt;分享我所知道的&lt;br/&gt;&lt;span style=&quot;float: right&quot;&gt; --by &lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li id=&quot;page_Message&quot;&gt; &lt;img src=&quot;images/bg_content.png&quot; alt=&quot;&quot; class=&quot;bg_cont&quot;&gt; &lt;span class=&quot;back&quot;&gt;&lt;img src=&quot;images/nav4.png&quot; alt=&quot;&quot; usemap=&quot;#back&quot;&gt;&lt;a href=&quot;index.html#close&quot;&gt;返回&lt;/a&gt;&lt;/span&gt; &lt;div class=&quot;pad&quot;&gt; &lt;h2&gt;祝福我们&lt;/h2&gt; &lt;div class=&quot;relative&quot;&gt; &lt;div class=&quot;scroll&quot;&gt; &lt;div style=&quot;min-height: 300px; padding-bottom: 50px;&quot;&gt; &lt;!-- 多说评论框 start --&gt; &lt;div class=&quot;ds-thread&quot; data-thread-key=&quot;yyu&quot; data-title=&quot;bb&quot; data-url=&quot;http://&quot;&gt;&lt;/div&gt; &lt;!-- 多说评论框 end --&gt; &lt;!-- 多说公共JS代码 start (一个网页只需插入一次) --&gt; &lt;script type=&quot;text/javascript&quot;&gt; var duoshuoQuery = {short_name:&quot;love90&quot;}; (function() { var ds = document.createElement(&#39;script&#39;); ds.type = &#39;text/javascript&#39;;ds.async = true; ds.src = (document.location.protocol == &#39;https:&#39; ? &#39;https:&#39; : &#39;http:&#39;) + &#39;/static.duoshuo.com/embed.js&#39;; ds.charset = &#39;UTF-8&#39;; (document.getElementsByTagName(&#39;head&#39;)[0] || document.getElementsByTagName(&#39;body&#39;)[0]).appendChild(ds); })(); &lt;/script&gt; &lt;!-- 多说公共JS代码 end --&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li id=&quot;page_Blog&quot;&gt; &lt;img src=&quot;images/bg_content.png&quot; alt=&quot;&quot; class=&quot;bg_cont&quot;&gt; &lt;span class=&quot;back&quot;&gt;&lt;img src=&quot;images/nav5.png&quot; alt=&quot;&quot; usemap=&quot;#back&quot;&gt;&lt;a href=&quot;index.html#close&quot;&gt;返回&lt;/a&gt;&lt;/span&gt; &lt;div class=&quot;pad&quot;&gt; &lt;h2&gt;爱的映像&lt;/h2&gt; &lt;div class=&quot;relative&quot;&gt; &lt;div class=&quot;scroll&quot;&gt; &lt;ul class=&quot;gallery fancybox&quot;&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/imglsh001.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/imglsh001small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/imglsh002.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/imglsh002small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/img003.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/img003small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/imglsh001.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/imglsh001small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/imglsh002.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/imglsh002small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/img003.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/img003small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/img004.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/img004small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/imglsh002.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/imglsh002small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/img003.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/img003small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;li style=&quot;line-height:120px&quot;&gt;&lt;a href=&quot;images/uploadimage/img004.jpg&quot; rel=&quot;prettyPhoto[gallery1]&quot;&gt;&lt;img src=&quot;images/uploadimage/img004small.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li id=&quot;page_Time&quot;&gt; &lt;img src=&quot;images/bg_content.png&quot; alt=&quot;&quot; class=&quot;bg_cont&quot;&gt; &lt;span class=&quot;back&quot;&gt;&lt;img src=&quot;images/nav6.png&quot; alt=&quot;&quot; usemap=&quot;#back&quot;&gt;&lt;a href=&quot;index.html#close&quot;&gt;返回&lt;/a&gt;&lt;/span&gt; &lt;div class=&quot;pad&quot;&gt; &lt;h2&gt;时光沙漏&lt;/h2&gt; &lt;div id=&quot;loveHeart&quot; style=&quot;margin-top: 30px;font-size: 25px;&quot;&gt; &lt;span style=&quot;&quot;&gt;宝贝你知道我爱你爱了多久了吗?&lt;/span&gt; &lt;div id=&quot;elapseClock&quot; style=&quot;margin: 10px 0px 10px 0px;&quot;&gt;&lt;/div&gt; &lt;img src=&quot;images/1.gif&quot; /&gt;    &lt;img src=&quot;images/2.gif&quot; /&gt;&lt;br/&gt;&lt;br/&gt; &lt;div id=&quot;loveu&quot;&gt; 爱:从2014-2-6开始!&lt;br/&gt; &lt;div class=&quot;signature&quot; style=&quot;float: right; margin-right: 50px;&quot;&gt;by 浟佳 &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/article&gt; &lt;!--content end--&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;bg1&quot;&gt; &lt;div class=&quot;main&quot;&gt; &lt;!--footer --&gt; &lt;footer style=&quot;line-height:20px&quot;&gt; &lt;div id=&quot;copyright&quot;&gt; &lt;script language=&quot;JavaScript&quot;&gt;&lt;/script&gt; &lt;/div&gt; &lt;!-- {%FOOTER_LINK} --&gt; &lt;/footer&gt; &lt;!--footer end--&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; $(window).load(function() { $(&#39;.page_spinner&#39;).fadeOut(); $(&#39;body&#39;).css({overflow:&#39;visible&#39;}); }) &lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;//修改时光沙漏时间 var offsetX = $(&quot;#loveHeart&quot;).width() / 2; var offsetY = $(&quot;#loveHeart&quot;).height() / 2 - 55; var together = new Date(); together.setFullYear(2014, 02, 06); together.setHours(17); together.setMinutes(0); together.setSeconds(0); together.setMilliseconds(0); setTimeout(function () { adjustWordsPosition(); startHeartAnimation(); }, 3000); timeElapse(together); setInterval(function () { timeElapse(together); }, 500); adjustCodePosition(); $(&quot;#code&quot;).typewriter(); &lt;/script&gt; &lt;audio id=&quot;bgmMusic&quot; src=&quot;http://www.51mp3ring.com/51mp3ring_com2/at200611121582079026.mp3&quot; preload=&quot;auto&quot; type=&quot;audio/mp3&quot; autoplay loop&gt;&lt;/audio&gt; &lt;!--coded by koma--&gt; &lt;!--LIVEDEMO_00 --&gt; &lt;/body&gt; &lt;/head&gt; &lt;/html&gt;补充并修改该代码
最新发布
05-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值