最近网站改版,首页要显示图片新闻,效果如下:
网站首页图片动态更换显示【Flash】
主要是下载了个Flash,然后改了改代码。不过其中设计的问题还是觉得非常有必要记下来。下面是代码
 1网站首页图片动态更换显示【Flash】<script type="text/javascript">
 2网站首页图片动态更换显示【Flash】                                                                                    <!--    
 3网站首页图片动态更换显示【Flash】                                                                                    var focus_width=154//156
 4网站首页图片动态更换显示【Flash】                                                                                    var focus_height=140//143
 5网站首页图片动态更换显示【Flash】                                                                                    var text_height=0
 6网站首页图片动态更换显示【Flash】                                                                                    var swf_height = focus_height+text_height
 7网站首页图片动态更换显示【Flash】                                                                                    var pics='<%= strPic %>'
 8网站首页图片动态更换显示【Flash】                                                                                    var links='<%= strLink %>'
 9网站首页图片动态更换显示【Flash】                                                                                    //var pics='http://images.17173.com/cabal/2006-11/20061208b.jpg?|http://images.17173.com/cabal/2006-11/20061208b.jpg?|http://images.17173.com/cabal/2006-11/20061208a.jpg'
10网站首页图片动态更换显示【Flash】                                                                                    //var links='http://cabal.17173.com/wq/ssj.html|http://cabal.17173.com/zyjs/kjs_2.html|http://cabal.17173.com/dj/dj_2.html'
11网站首页图片动态更换显示【Flash】                                                                                    var texts='惊天动地热门话题|惊天动地热门话题222'
12网站首页图片动态更换显示【Flash】                                                                                    
13网站首页图片动态更换显示【Flash】                                                                                    document.write('<table style="background-color:#ECECEC; width:100%;height:100%;" border="0px;" >');                                                                                
14网站首页图片动态更换显示【Flash】                                                                                    document.write('<tr><td style="padding-left:1px;padding-right:1px;" nowrap="nowrap">');    
15网站首页图片动态更换显示【Flash】                                                                                    document.write('<object class>>

 1网站首页图片动态更换显示【Flash】//取出Flash中图片Url和目标地址
 2网站首页图片动态更换显示【Flash】            string strHead = Request.Url.ToString().Substring(0, Request.Url.ToString().LastIndexOf(@"/"));
 3网站首页图片动态更换显示【Flash】        
 4网站首页图片动态更换显示【Flash】            mnMain.NewsImage(sqlConn, ref strPic, ref strLink, 3,strHead);
 5网站首页图片动态更换显示【Flash】
 6网站首页图片动态更换显示【Flash】//取出旅游资讯Flash中要显示的图片的Url,以及目标地址
 7网站首页图片动态更换显示【Flash】        public void NewsImage(SqlDatabaseConnection sqlConn,ref string strPic, ref string strLink,int PageCount,string strHead)
 8        }


这其中因为有本地测试与发布之分,故使用Request.Url取出当前请求地址.使代码在发布前不必修改

相关文章: