Skip to content

Commit e8fe7cc

Browse files
committed
Update index
1 parent 5079f8e commit e8fe7cc

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

HanoiAll.htm

+25-25
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
.log{width:228px;float:left;text-align:left;margin:0 4px;}
2929
</style>
30-
<script type="text/javascript" src="jquery-1.9.0.js"></script>
30+
<script type="text/javascript" src="jquery.min.js"></script>
3131
<script>
3232
/**
3333
思路:
@@ -52,10 +52,10 @@
5252
//3个底座的名字
5353
Hnt.A.name = 'A';
5454
Hnt.B.name = 'B';
55-
Hnt.C.name = 'C';
56-
//三个底座的顺序号
57-
Hnt.A.val = 1;
58-
Hnt.B.val = 2;
55+
Hnt.C.name = 'C';
56+
//三个底座的顺序号
57+
Hnt.A.val = 1;
58+
Hnt.B.val = 2;
5959
Hnt.C.val = 3;
6060
//底座的top值
6161
Hnt.defTop = 0;
@@ -344,10 +344,10 @@
344344
//清空数组
345345
Hnt.A.length = 0;
346346
Hnt.B.length = 0;
347-
Hnt.C.length = 0;
347+
Hnt.C.length = 0;
348348

349349
movie.length = 0;
350-
350+
351351
order = 0;
352352

353353
Hnt.clearText($txt);
@@ -382,28 +382,28 @@
382382

383383
//开始创建 - 数字小的在最上面
384384
for(var i = 0;i<num;i++){
385-
Hnt.createBlock(
386-
{
387-
order:(num-i),
388-
top:start.top-((i+1)*(_height+1)),
389-
left:(start.left+_wstep*i),
390-
height:_height,
391-
width:opt.maxWidth - i*2*_wstep
385+
Hnt.createBlock(
386+
{
387+
order:(num-i),
388+
top:start.top-((i+1)*(_height+1)),
389+
left:(start.left+_wstep*i),
390+
height:_height,
391+
width:opt.maxWidth - i*2*_wstep
392392
});
393393
}
394394
}
395395

396396
//创建盘子
397397
Hnt.createBlock = function(position){
398-
$('<div>').addClass('block')
399-
.addClass('bl'+position.order)
400-
.css({
401-
top:position.top,
402-
left:position.left,
403-
height:position.height,
404-
width:position.width
405-
})
406-
.appendTo($('#block'));
398+
$('<div>').addClass('block')
399+
.addClass('bl'+position.order)
400+
.css({
401+
top:position.top,
402+
left:position.left,
403+
height:position.height,
404+
width:position.width
405+
})
406+
.appendTo($('#block'));
407407

408408
Hnt.A.push('.bl'+position.order);
409409
}
@@ -440,8 +440,8 @@
440440
//初始化
441441
$('#init').click(function(){
442442
Hnt.initBlock($('#num').val());
443-
});
444-
443+
});
444+
445445
//数字正则
446446
var regx = /[1-9]+[0-9]*/g
447447
//改变时间

hanoi.htm index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
.log{width:228px;float:left;text-align:left;margin:0 4px;}
2929
</style>
30-
<script type="text/javascript" src="jquery-1.9.0.js"></script>
30+
<script type="text/javascript" src="jquery.min.js"></script>
3131
<script type="text/javascript" src="hanoi.js"></script>
3232
<style>
3333
#test{width:500px;height:200px;position: relative;background-color: yellow;}

0 commit comments

Comments
 (0)