100分,最先答对的给满分,作轮换图片效果时,图片路径一变就不好使了,请高手救命。
我是照着CSDN那个轮换图片作的代码也是从CSDN找的如下<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="author" content="meizz" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/jsframework.js"></script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/System/Global.js"></script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/System/Data/MzDataProvider.js"></script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/System/Web/Forms/MzEffect.js"></script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/System/Web/Forms/MzBehavior.js"></script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/System/Web/UI/WebControls/MzRotateImage.js"></script>
<title>CSDN 轮换广告</title>
</head>
<body style="margin: 3px">
<script type="text/javascript">/*<![CDATA[*/
//Using("System.Web.UI.WebControls.MzRotateImage");
var data = {}
data["-1_1"] = "img: http://zi.csdn.net/no1.280-187.gif; url: http://z.csdn.net/adclick.php?bannerid=395; target: _blank; alt: ;";
data["-1_2"] = "img: http://zi.csdn.net/no2-280_187.gif; url: http://z.csdn.net/adclick.php?bannerid=459; target: _blank; alt: ;";
data["-1_3"] = "img: http://zi.csdn.net/no3.gif; url: http://z.csdn.net/adclick.php?bannerid=401; target: _blank; alt: ;";
data["-1_4"] = "img: http://zi.csdn.net/no4.jpg; url: http://z.csdn.net/adclick.php?bannerid=410; target: _blank; alt: ;";
data["-1_5"] = "img: http://zi.csdn.net/no5.jpg; url: http://z.csdn.net/adclick.php?bannerid=369; target: _blank; alt: ;";
data["-1_6"] = "img: http://zi.csdn.net/no.6.280.187.gif; url: http://z.csdn.net/adclick.php?bannerid=372; target: _blank; alt: ;";
var ri = new MzRotateImage();
ri.dataSource = data;
ri.width = 280;
ri.height = 187;
ri.interval = 3000;
ri.duration = 2000;
document.write(ri.render());
/*]]>*/</script>
</body>
</html>
//当我把图片路径改为相对路径时,就出现没图片或图片变小的错误,
data["-1_1"] = "img: pics/no1.280-187.gif; url: http://z.csdn.net/adclick.php?bannerid=395; target: _blank; alt: ;";
我急用,请速回答。
--------------------编程问答-------------------- 路径不对 --------------------编程问答-------------------- 晕了.
--------------------编程问答-------------------- 没图片是路径不对,图片变小是大小不对.
--------------------编程问答-------------------- 原图是280*187的大小.
--------------------编程问答-------------------- 看代码看的头晕
我给你个源代码把楼主!记着把下面代码中图片的路径换一下就可以啦!:)
<script type="text/javascript">
<!--
var focus_width=199
var focus_height=190
var text_height=0
var swf_height = focus_height+text_height
var pics='/Image/JianCai/JianCai/HuanDeng/1.gif|/Image/JianCai/JianCai/HuanDeng/2.gif|/Image/JianCai/JianCai/HuanDeng/3.gif|/Image/JianCai/JianCai/HuanDeng/3.gif'
var links='http://www.ChinaJianCai.cn|http://www.ChinaJianCai.cn|http://www.ChinaJianCai.cn|http://www.ChinaJianCai.cn'
var texts='1|2|3|4'
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="/Image/JianCai/JianCai/HuanDeng/toppic.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');document.write('</object>');
//-->
</script> --------------------编程问答-------------------- mark --------------------编程问答-------------------- http://www.cnblogs.com/tjsquall/archive/2007/12/24/1012978.html
http://www.cnblogs.com/tiantangwater/archive/2008/12/24/1361667.html
补充:.NET技术 , ASP.NET