//数据库部分
Create table users ----用户
(
userid int, ---用户id,唯一标识
Username varchar(20), ---用户名
Password varchar(20), ---密码
Auth tinyint --验证id(默认0表示未验证)
);
Create table mag----杂志
(
Magid int, --杂志id,唯一标示
Magname varchar(20),----杂志名称
Folder varchar(20), --杂志所放文件夹名称(由系统时间生成
)
Maglogo varchar(50),-------杂志logo地址
PageCount int,---杂志页数
Userid int –所属用户id
);
Create table page ---杂志页面
(
Pageid int, ---页面id
Subid int,---内部id(页数)
Mid int, --- 所属杂志id
Title varchar(50), ----标题
Picurl varchar(100),--图片url
Exist tinyint --是否已经添加
);
Create table pic ---图片
(
Picid int, ---图片id
Magid int, ---所属杂志id
Pagid int ---所属页面id
);
Create table Link --文字
(
Lid int, --链接id
gTop int, --链接位置
gLeft int,
gWidth int,
gHeight int,
Pid int, --页面id
lValue varchar(100)
);
///js2.js介绍
var PageCount=24;//记下pageCount,用在control.html上
//总页数显示,以及推荐标题
var Title = new Array();//用于control.html上推荐标题显示
Title[1] = '卖书';
Title[2] = '';
慢慢明白了下面的js是Dreamweaver可视化自动生成的
实现:禁止按键,预加载图片,根据鼠标点击交换显示图片,查找对
象
//禁止ctrl+n和 禁止ctrl+r和 禁止shift+f10 禁止鼠标右键or左右
键 和禁止f5 的JS代码
function onKeyDown()
{
if ((event.altKey)||((event.keyCode==8)&&
(event.srcElement.type!="text"&&event.srcElement.type!
="textarea"&&event.srcElement.type!="password"))||
((event.ctrlKey)&&((event.keyCode==78)||
(event.keyCode==82)))||(event.keyCode==116))
{
event.keyCode=0;
event.returnValue=false;
}
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new
Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for
(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p
[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])
&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))
>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!
x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj
(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return
x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new
Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;
if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
自己写的js
function click(e)
{
if (document.all) {
if (event.button==2||event.button==3) {
οncοntextmenu='return false';
}
}
if (document.layers) {
if (e.which == 3) {
οncοntextmenu='return false';
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.οnmοusedοwn=click;
document.oncontextmenu = new Function("return
false;")//禁止右键菜单
//js代码
var PageCount=24;
var Location = new Array();
var PicOrder = new Array();
var Link = new Array();
Location[1] = new Array();
Link[1] = new Array();
PicOrder[1] = 1;
//move.html核心代码:
function rt()
{
window.document.execCommand('stop');//将网页停止
big_link.style.visibility = "hidden";//big_link是
960*1320大图div
bgpic.innerHTML='';
for(i=1;i<89;i++)
{
document.getElementById
('a'+i.toString()).src='spacer.gif';
}
mouse_up.style.visibility="hidden";
mouse_down.style.visibility="hidden";//上下两个箭头
guid.style.visibility="hidden";
guid = null;//红线框
load1.style.visibility="hidden";
load2.style.visibility="hidden";//红线框底长小图
bgpic.style.visibility="hidden";//960*1420 公用装载
放大的小图
bigpic.style.visibility="hidden";//960*1320放着88张
透明小图片的层
}
//md负责960*1320大图的拖动
var mY,oY;
var guid;
function md(){
if (window.event.button!=1)
{
window.document.execCommand('stop');
can_P = true;
can_N = true;
big_link.style.visibility = "hidden";
bgpic.innerHTML='';
for(i=1;i<89;i++)
{
document.getElementById
('a'+i.toString()).src='spacer.gif';
}
mouse_up.style.visibility="hidden";
mouse_down.style.visibility="hidden";
guid.style.visibility="hidden";
guid = null;
load1.style.visibility="hidden";
load2.style.visibility="hidden";
bgpic.style.visibility="hidden";
bigpic.style.visibility="hidden";
}
else{
mY = parseInt(event.y,10);
oY = parseInt(bigpic.style.top,10);
oY2 = parseInt(guid.style.top,10);
window.bigpic.setCapture();
window.bigpic.style.cursor="../../image/handhold.cur";
window.bigpic.οnmοusemοve=function(){
if(oY + (parseInt(event.y,10)-mY)>-700)
{
if(oY + (parseInt(event.y,10)-mY)< 0)
{
bigpic.style.top=oY + (parseInt(event.y,10)
-mY);
guid.style.top = oY2 - (parseFloat
(event.y,10)-mY)*96/1320;
}
else
{
bigpic.style.top=0;
guid.style.top = load.style.top;
}
}
else
{
bigpic.style.top=-700;
guid.style.top = parseInt(load.style.top,10)+50;
}
bgpic.style.top = bigpic.style.top;
big_link.style.top = bigpic.style.top;
check_mouse_state();
}
bigpic.onmouseup = function(){
bigpic.releaseCapture();
bigpic.style.cursor="../../image/hand.cur";
bigpic.οnmοusemοve=null;
}
}
}
var m_Y;
var o_Y;
var o_Y2;
//鼠标的滚轮控制大层移动
function img_move(e) //图片鼠标滚轮缩放
{
if(parseInt(bigpic.style.top,10)+event.wheelDelta/3
> -700)
{
if(parseInt(bigpic.style.top,10)
+event.wheelDelta/5 < 0)
{
if(parseInt(bigpic.style.top,10)
+event.wheelDelta/5 > -event.wheelDelta/5)
{
bigpic.style.top = 0;
guid.style.top = load.style.top;
}
else
{
bigpic.style.top = parseInt
(bigpic.style.top,10)+event.wheelDelta/5;
guid.style.top = parseFloat
(guid.style.top,10)-event.wheelDelta/5*96/1320;
}
}
else
{
bigpic.style.top = 0;
guid.style.top = load.style.top;
}
}
else
{
bigpic.style.top = -700
guid.style.top = parseInt(load.style.top,10)+50;
}
bgpic.style.top = bigpic.style.top;
big_link.style.top = bigpic.style.top;
check_mouse_state();
return false;
}
//鼠标左击450*620small_L_A/small_L_B/small_R_A/small_R_B小图
后执行的事件: 显示960*1320的大图
var ky;
var num;
var load;
function showbig(x)
{
big_link.innerHTML = '';
download.style.visibility="hidden";
var i;
if(x.toString() == 'L')
{
load1.style.visibility="visible";
mouse_up.style.visibility="visible";
mouse_down.style.visibility="visible";
guid = guid1;
load = load1;
load.style.top=20;
load.style.left=80;
guid.style.top=20;
guid.style.left=80;
bgpic.innerHTML = "<img src=/"pic"+PicOrder
[idx_L].toString()+"_small.jpg/" border=0 width=100% alt=/"
左键拖动浏览,右键返回小图/">";
bgpic.style.visibility="visible";
for(i=1;i<Location[idx_L].length;i++)
{
big_link.innerHTML = big_link.innerHTML +
"<div id=/"local"+i+"/" style=/"LEFT: "+Location[idx_L][i]
[1]+"px; POSITION: absolute; TOP:"+Location[idx_L][i][2]
+"px; WIDTH:"+Location[idx_L][i][3]+"px;height:"+Location
[idx_L][i][4]+"px;Z-INDEX:12;/"><img alt=/""+Link[idx_L]
[i].toString().split("|")[1]+"/" style=/"cursor:hand/"
class=/"link/" border=/"0/" src=/"../../image/link.gif/"
width=/"100%/" height=/"100%/" οnclick=/"openlink('"+Link
[idx_L][i].toString().split("|")[0]+"')/"
onMouseOver=/"this.src='../../image/link_hover.gif'/"
onMouseDown=/"md();/"
onMouseOut=/"this.src='../../image/link.gif'/"></div>";
}
setTimeout("bd('L');big_link.style.visibility =
/"visible/";",10)
}
else
{
guid = guid2;
load2.style.visibility="visible";
load = load2;
load.style.top=20;
load.style.left=860;
guid.style.top=20;
guid.style.left=860;
mouse_up.style.visibility="visible";
mouse_down.style.visibility="visible";
bgpic.innerHTML = "<img src=/"pic"+PicOrder
[idx_R].toString()+"_small.jpg/" border=0 width=100% alt=/"
左键拖动浏览,右键返回小图/">";
bgpic.style.visibility="visible";
for(i=1;i<Location[idx_R].length;i++)
{
big_link.innerHTML = big_link.innerHTML +
"<div id=/"local"+i+"/" style=/"LEFT: "+Location[idx_R][i]
[1]+"px; POSITION: absolute; TOP:"+Location[idx_R][i][2]
+"px; WIDTH:"+Location[idx_R][i][3]+"px;height:"+Location
[idx_R][i][4]+"px;Z-INDEX:12;/"><img alt=/""+Link[idx_R]
[i].toString().split("|")[1]+"/" style=/"cursor:hand/"
class=/"link/" border=/"0/" src=/"../../image/link.gif/"
width=/"100%/" height=/"100%/" οnclick=/"openlink('"+Link
[idx_R][i].toString().split("|")[0]+"')/"
onMouseOver=/"this.src='../../image/link_hover.gif'/"
onMouseDown=/"md();/"
onMouseOut=/"this.src='../../image/link.gif'/"></div>"
}
setTimeout("bd('R');big_link.style.visibility =
/"visible/";",10);
}
guid.style.visibility = "visible";
ky =310-parseFloat(event.y,10)*1320/620;
num = Math.floor(parseFloat(event.y,10)
*1320/620/120)+1;
if(ky>-700)//根据鼠标点击的位置来定位guid
{
if(ky<0)
{
bigpic.style.top=ky;
big_link.style.top=ky;
guid.style.top = parseInt
(load.style.top,10)-ky*96/1320;
}
else
{
bigpic.style.top=0
big_link.style.top=0
guid.style.top = load.style.top;
}
}
else
{
bigpic.style.top=-700;
big_link.style.top=-700;
guid.style.top = parseInt
(load.style.top,10)+50;
}
bgpic.style.top=bigpic.style.top;
check_mouse_state();
}
//红线框上下移动事件
function move_guid()
{
m_Y = parseInt(event.y,10);
o_Y = parseInt(bigpic.style.top,10);
o_Y2 = parseInt(guid.style.top,10);
guid.setCapture();
guid.style.cursor="move";
guid.οnmοusemοve=function(){
if(o_Y2 + (parseInt(event.y,10)-m_Y)> parseInt
(load.style.top,10))
{
if(o_Y2 + (parseInt(event.y,10)-m_Y)<parseInt
(load.style.top)+50)
{
bigpic.style.top=o_Y - (parseFloat
(event.y,10)-m_Y)*1320/96;
guid.style.top = o_Y2 + (parseInt
(event.y,10)-m_Y)
}
else
{
guid.style.top = parseInt
(load.style.top,10)+50;
bigpic.style.top=-700;
}
}
else
{
guid.style.top = load.style.top;
bigpic.style.top=0;
}
bgpic.style.top = bigpic.style.top;
big_link.style.top = bigpic.style.top;
check_mouse_state();
}
guid.onmouseup = function(){
guid.releaseCapture();
guid.style.cursor="auto";
guid.οnmοusemοve=null;
}
}
//bigpic里面每个td放的120*120小图开始加载
function bd(x)
{
document.execCommand("stop");
if(x.toString() == 'L')
{
for(j=0;j<11;j++)
{
if(num+j<12)
{
for(k=0;k<4;k++)
{
document.getElementById
('a'+((num+j-1)*8+4-k).toString()).src='pic'+PicOrder
[idx_L].toString()+'/pic_'+((num+j-1)*8+4-k).toString()
+'.jpg';
document.getElementById
('a'+((num+j-1)*8+5+k).toString()).src='pic'+PicOrder
[idx_L].toString()+'/pic_'+((num+j-1)*8+5+k).toString()
+'.jpg';
}
}
if(num-j>0)
{
for(k=0;k<4;k++)
{
document.getElementById
('a'+((num-j-1)*8+4-k).toString()).src='pic'+PicOrder
[idx_L].toString()+'/pic_'+((num-j-1)*8+4-k).toString()
+'.jpg';
document.getElementById
('a'+((num-j-1)*8+5+k).toString()).src='pic'+PicOrder
[idx_L].toString()+'/pic_'+((num-j-1)*8+5+k).toString()
+'.jpg';
}
}
}
}
else
{
for(j=0;j<11;j++)
{
if(num+j<12)
{
for(k=0;k<4;k++)
{
document.getElementById
('a'+((num+j-1)*8+4-k).toString()).src='pic'+PicOrder
[idx_R].toString()+'/pic_'+((num+j-1)*8+4-k).toString()
+'.jpg';
document.getElementById
('a'+((num+j-1)*8+5+k).toString()).src='pic'+PicOrder
[idx_R].toString()+'/pic_'+((num+j-1)*8+5+k).toString()
+'.jpg';
}
}
if(num-j>0)
{
for(k=0;k<4;k++)
{
document.getElementById
('a'+((num-j-1)*8+4-k).toString()).src='pic'+PicOrder
[idx_R].toString()+'/pic_'+((num-j-1)*8+4-k).toString()
+'.jpg';
document.getElementById
('a'+((num-j-1)*8+5+k).toString()).src='pic'+PicOrder
[idx_R].toString()+'/pic_'+((num-j-1)*8+5+k).toString()
+'.jpg';
}
}
}
}
bigpic.style.visibility="visible"; //让清晰大图显示
在顶端}
}
//上下两个箭头鼠标放在上面可以控制自动滚动大图
var mouse_state;
var time9;
function pic_move_up()
{
if(parseInt(bigpic.style.top,10) <0)
{
if(parseInt(bigpic.style.top,10) > -40)
{
bigpic.style.top = 0;
guid.style.top = load.style.top;
mouse_up.style.visibility="hidden";
mouse_down.style.visibility = "visible";
}
else
{
bigpic.style.top = parseInt
(bigpic.style.top,10)+40;
guid.style.top = parseInt
(guid.style.top,10) - 40*96/1320;
mouse_down.style.visibility =
"visible";
}
}
else
{
bigpic.style.top = 0;
guid.style.top = load.style.top;
mouse_up.style.visibility="hidden";
mouse_down.style.visibility = "visible";
}
bgpic.style.top = bigpic.style.top;
big_link.style.top= bigpic.style.top;
}
function check_mouse_state()
{
if(parseInt(bigpic.style.top,10)<0)
{
mouse_down.style.visibility = "visible";
if(parseInt(bigpic.style.top,10)>-700)
{
mouse_up.style.visibility =
"visible";
}
else
{
mouse_down.style.visibility = "hidden";
}
}
else
{
mouse_up.style.visibility = "hidden";
}
}
function MouseDown_up()
{
if(time9!=null)
{
clearInterval(time9);
}
mouse_state = false;
time9=setInterval("if(check_state()){clearInterval
(time9);}else{pic_move_up()}",10);
mouse_up.onmouseout = function mouse_out1()
{
mouse_state = true;
};
}
function pic_move_down()
{
if(parseInt(bigpic.style.top,10) > -700)
{
if(parseInt(bigpic.style.top,10) <
-660)
{
bigpic.style.top = -700;
guid.style.top = parseInt
(load.style.top,10)+50;
mouse_down.style.visibility
= "hidden";
mouse_up.style.visibility="visible";
}
else
{
bigpic.style.top = parseInt
(bigpic.style.top,10)-40;
guid.style.top = parseInt
(guid.style.top,10) + 40*96/1320;
mouse_up.style.visibility =
"visible";
}
}
else
{
bigpic.style.top = -700;
guid.style.top = parseInt
(load.style.top,10)+50;
mouse_down.style.visibility =
"hidden";
mouse_up.style.visibility="visible";
}
bgpic.style.top = bigpic.style.top;
big_link.style.top = bigpic.style.top;
}
function MouseDown_down()
{
if(time9!=null)
{
clearInterval(time9);
}
mouse_state = false;
time9=setInterval("if(check_state()){clearInterval
(time9);}else{pic_move_down();}",10);
mouse_down.onmouseout = function mouse_out2()
{
mouse_state = true;
};
}
function check_state()
{
return mouse_state;
}
//重要初始化move.htm
function show_cp()
{
top.Control.ini_num.value = idx*2-1;
}
function initial(x)
{
document.getElementById
("download").style.visibility="visible";
if(time1 != null || time2 != null)
{
clearInterval(time1);
clearInterval(time2);
}
if(bigpic.style.visibility=="visible")
{
rt();
}
idx=x;
idx_L = 2*x-1;
idx_R = 2*x;
if(top.Control.ini_num != null)
{
show_cp();
}
link_L.innerHTML = '';
link_R.innerHTML='';
load1.innerHTML = "<img src=/"pic"+PicOrder
[idx_L].toString()+"_small.jpg/" width=/"100%/"
height=/"100%/" alt=/"左键放大 右键翻页/">";
load2.innerHTML = "<img src=/"pic"+PicOrder
[idx_R].toString()+"_small.jpg/" width=/"100%/"
height=/"100%/" alt=/"左键放大 右键翻页/">";
if(x%2 == 1)
{
smallpic_L_A.style.backgroundImage="url
(pic"+PicOrder[idx_L].toString()+"_small.jpg)";
smallpic_L_A.innerHTML = load1.innerHTML;
smallpic_R_A.style.backgroundImage="url
(pic"+PicOrder[idx_R].toString()+"_small.jpg)";
smallpic_R_A.innerHTML = load2.innerHTML;
time1=setInterval("if(jiancha())
{small_L_A.style.zIndex=2;small_R_A.style.zIndex=2;small_L_B
.style.zIndex=1;small_R_B.style.zIndex=1;clearInterval
(time1);getlink();can_N=true;can_P=true;mouse_action
();}",100);
}
else
{
smallpic_L_B.style.backgroundImage="url
(pic"+PicOrder[idx_L].toString()+"_small.jpg)";
smallpic_L_B.innerHTML = load1.innerHTML;
smallpic_R_B.style.backgroundImage="url
(pic"+PicOrder[idx_R].toString()+"_small.jpg)";
smallpic_R_B.innerHTML = load2.innerHTML;
time2=setInterval("if(jiancha())
{small_L_B.style.zIndex=2;small_R_B.style.zIndex=2;small_L_A
.style.zIndex=1;small_R_A.style.zIndex=1;clearInterval
(time2);getlink();can_N=true;can_P=true;mouse_action
();}",100);
}
//*********预载下一页的图片
if(PicOrder[idx_L+2]!=null && PicOrder[idx_R+2]!
=null)
{
heavyImage_1 = new Image();
heavyImage_1.src = "spacer.gif";
heavyImage_L = new Image();
heavyImage_L.src = "pic"+(PicOrder[idx_L+2]).toString()
+"_small.jpg";
heavyImage_R = new Image();
heavyImage_R.src = "pic"+(PicOrder[idx_R+2]).toString()
+"_small.jpg";
}
}