找回密码
 注册
查看: 3931|回复: 5
收起左侧

[分享] 仿腾讯官方网站首页的天气预报插件适用于任何程序

  [复制链接]

5312

主题

8317

帖子

1万

积分

管理员

出售国内外虚拟空间

Rank: 10Rank: 10Rank: 10

积分
14660
帖子
8317
精华
67
体力
14660 点
蓝豆
2391 点
注册时间
2007-6-8

终身成就奖LY官方团队会员身份ID卡

发表于 2011-1-4 22:50:03 | 显示全部楼层 |阅读模式
透明图标,昼夜有别,白天显示太阳,夜晚显示月亮,个性十足。所涉及的天气图片已经全部本地化,还能根据ip自动显示所在城市天气,有连接,点开为未来三日天气预报
安装方法:
解压后将weather目录上传到网站根目录,在你要插入天气预报的地方加入以下代码:
  1. <STYLE>
  2. i {display:block; float:left; width:60px; font:normal 14px/28px 微软雅黑; margin-left:30px; color:#FF3300;}
  3. .date {display:block; float:right; font:normal 14px/28px 微软雅黑; margin-right:15px; color:#FF3300;}
  4. #Wealth{display:block; float:left; line-height:34px; height:34px; padding:0px;margin:0px;cursor:pointer;}
  5. #Wealth h6{display:block; float:left; margin-left:5px; font:normal 14px/28px 微软雅黑; padding-top:0px;color:#ff9900;}
  6. #Wealth span.img{display:block; float:left; width:24px; height:24px;}
  7. #Wealth div{display:block; float:left; font:normal 14px/28px 微软雅黑; margin-left:5px; color:#FF3300;}
  8. </style>
  9. <i>天气预报:</i>
  10. <SCRIPT language=javascript type=text/javascript>
  11. function loadPng(o)
  12. {if(MiniSite.Browser.ie){try{var img = o;var imgName = o.src.toUpperCase();if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
  13. {var imgID = (img.id) ? "id='" + img.id + "' " : "";var imgClass = (img.className) ? "class='" + img.className + "' " : "";var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";var imgStyle = "display:inline-block;" + img.style.cssText;if (img.align == "left") imgStyle = "float:left;" + imgStyle;if (img.align == "right") imgStyle = "float:right;" + imgStyle;if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle ; var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style="" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');"></span>"; img.outerHTML = strNewHTML; }} catch (e){}}}
  14. </script>
  15. <script type="text/javascript" src="/weather/weather.js"></script>
  16. <div id="Wealth"></div>
  17. <script type="text/javascript">
  18. /*<![CDATA[*/
  19. MiniSite.Weather.print("Wealth");
  20. /*]]>*/
  21. </script>
复制代码

weather.rar

89.87 KB, 下载次数: 20, 下载积分: 体力 -1 点

出售国内或美国高性能虚拟空间,高速VPS以及服务器! 同时承接各种类型的网站制作,网站维护,支付宝交易安全放心!    联系QQ:6102031
懒得打字嘛,点击右侧快捷回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

网站公告上一条 /2 下一条

GMT+8, 2024-4-24 06:56 , Processed in 0.109375 second(s), 28 queries , Gzip On.

© 2006-2022 Powered by Discuz! X3.4

快速回复 返回顶部 返回列表