日期:2014-05-17  浏览次数:20459 次

asp.net图片轮换效果
网站首页要做个图片轮换效果,在网上找个好几个,都没有后台添加功能,有的也调试不成功,谁有好用点的给个学习。要能调试成功,后台要能添加。
是不是用flash+js实现,在后台添加图片、题目、内容等或者flash+xml实现,xml里的内容怎么添加到数据库,我不是很明白,期待着高手的指教。

------解决方案--------------------
你在网上找的,一般都会有一个配置文件,和具体的图片信息,后台维护实际上就是维护配置文件跟具体的图片。
至于xml里的内容怎么添加到数据库,查查操作xml方面的资料。
------解决方案--------------------
前台js
JScript code
<script type="text/javascript">
                                                                var focus_width = 229;
                                                                var focus_height = 188;
                                                                var focus_height = 188;
                                                                var text_height = 23;
                                                                var swf_height = focus_height + text_height;
                                                                var swf_height = focus_height;
                                                              [color=#FF0000]  var pics = "<%= gundongpic %>";[/color]
                                                                var texts = "|||";
                                                                var links = "Default.aspx|Default.aspx|Default.aspx|Default.aspx";
                                                                var keyword = "||||";
                                                                document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + focus_width + '" height="' + swf_height + '">');
                                                                document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash/pix.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
                                                                document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
                                                                document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&texts=&keyword=' + keyword + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
                                                                document.write('<embed src="flash/pix.swf" wmode="opaque" FlashVars="pics=' + pics + '&links=' + links + '&texts=&keyword=' + keyword + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" menu="false" bgcolor="#eeeeee" quality="high" width="' + focus_width + '" height="' + swf_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
                                                                document.write('</object>');
                        </script>

------解决方案--------------------
1.JS
2.Flash
3.ASP.NET中的Adrotator控件
------解决方案--------------------
/*
*此全部代码存为html可直接使用,或jsp中引用
*/
var widths=250; /*显示高度*/
var heights=150; /*显示宽度*/
var counts=5; /*照片数量*/

/**
*如果你是不固定的图片,可以使用数组定义,
让然下面一些代码也要有相应的改动,不多介绍,如果你不会可以问我。