asp.net+Flash动态图片切换演示

大型门户网站,如新闻网站,使用到的动态图片切换.

前台代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Img.aspx.cs" Inherits="Img" %>

<!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 runat="server">
    <title>ASP.net+Flash动态图片切换演示</title>
</head>
<body>

<div align ="center">
<script type="text/javascript">
var focus_width=253;
var focus_height=164;
var text_height=20;
var swf_height = focus_height+text_height;

var pics=<%=pics%>,links=<%=links%>,texts = <%=texts%>;

document.write('<object width="'+focus_width+'" height="'+swf_height+'">');
document.write('<param name="allowScriptaccess" value="sameDomain"><param name="wmode" value="transparent"><param name="movie" value="1/pixviewer.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('<embed src="1/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor=#ffffff quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptaccess="sameDomain" type="application/x-shockwave-flash" />');
document.write('</object>');
</script>
</div>

</body>
</html>


后台代码:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Img : System.Web.UI.Page
{
    public string pics = "''";
    public string links = "''";
    public string texts = "''";

    protected void Page_Load(object sender, EventArgs e)
    {
        pics = "'1/1.jpg'" + "+ '|' +" + "'1/4.jpg'" + " + '| '+" + "'1/2.jpg'" + "+ '| '+" + "'1/apple.jpg'";      //图片
        links = "'Img.aspx'" + "+ '|' +" + "'1/4.jpg'" + " + '| '+" + "'1/2.jpg'" + "+ '| '+" + "'1/apple.jpg'";    //链接
        texts = "'标题'" + "+ '|' +" + "'图二'" + " + '| '+" + "'1/2.jpg'" + "+ '| '+" + "'apple'";                 //点击文字说明
    }
}


资料来源于:www.codefans.net

本案例下载地址1:http://download.csdn.net/detail/lovegonghui/9228911

本案例下载地址2:http://down.51cto.com/data/2113109

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值