仿3721网页框架自由拖动效果包括六个文件,CDrag.mdb|News.asp|Pic.asp 这些是供测试的文件,需要在iis浏览才能看到效果,也可以直接在Index.htm看到相关效果,但是数据信息无法看到index.htm,
仿3721网页框架自由拖动效果
News.asp<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%><%Response.Charset = "gb2312";(function () {
var conn = Server.CreateObject("Adodb.Connection"); conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("Cdrag.mdb"); conn.Open; with (Response) { var rs = conn.Execute("Select Top 5 Content From [News] Order By Id Desc") if (!rs.Eof) { while (!rs.Eof) { Write(rs("Content").Value + "
"); rs.MoveNext } } else Write("没有信息的说"); rs.Close; rs = null; } conn.Close; conn = null;})();%>
News.jsvar News = Class.create();
News.prototype = { initialize : function () { var wc = this; wc.parent = null; wc.ajax = new CDrag.Ajax; }, edit : function (o) { alert("这个是扩展类的一个方法,可以从News.js里自己设置,比如现在改变内容为标题"); o.content.innerHTML = o.title.innerHTML; }, load : function (json) { var wc = this; wc.parent.content.innerHTML = json; }, open : function () { var wc = this, ajax = wc.ajax; wc.parent.content.innerHTML = "loading"; ajax.send("News.asp?", wc.load.bind(wc)); } };
News.loaded = true;
Pic.asp<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%><%Response.Charset = "gb2312";(function () {
var conn = Server.CreateObject("Adodb.Connection"); conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("Cdrag.mdb"); conn.Open; with (Response) { var rs = conn.Execute("Select Top 1 Src From [Pic] Order By Id Desc") if (!rs.Eof) { Write(rs("Src").Value); } else Write("没有信息的说"); rs.Close; rs = null; } conn.Close; conn = null;})();%>
Pic.jsvar Pic = Class.create();
Pic.prototype = { initialize : function () { var wc = this; wc.parent = null; wc.ajax = new CDrag.Ajax; }, edit : function (o) { alert(o.title.innerHTML); }, load : function (json) { var wc = this; wc.parent.content.innerHTML = '
'; }, open : function () { var wc = this, ajax = wc.ajax; wc.parent.content.innerHTML = "loading"; ajax.send("Pic.asp?", wc.load.bind(wc)); } };
Pic.loaded = true;