Commit e8fe7cc 1 parent 5079f8e commit e8fe7cc Copy full SHA for e8fe7cc
File tree 3 files changed +30
-26
lines changed
3 files changed +30
-26
lines changed Original file line number Diff line number Diff line change 27
27
28
28
.log {width : 228px ;float : left;text-align : left;margin : 0 4px ;}
29
29
</ style >
30
- < script type ="text/javascript " src ="jquery-1.9.0 .js "> </ script >
30
+ < script type ="text/javascript " src ="jquery.min .js "> </ script >
31
31
< script >
32
32
/**
33
33
思路:
52
52
//3个底座的名字
53
53
Hnt . A . name = 'A' ;
54
54
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 ;
59
59
Hnt . C . val = 3 ;
60
60
//底座的top值
61
61
Hnt . defTop = 0 ;
344
344
//清空数组
345
345
Hnt . A . length = 0 ;
346
346
Hnt . B . length = 0 ;
347
- Hnt . C . length = 0 ;
347
+ Hnt . C . length = 0 ;
348
348
349
349
movie . length = 0 ;
350
-
350
+
351
351
order = 0 ;
352
352
353
353
Hnt . clearText ( $txt ) ;
382
382
383
383
//开始创建 - 数字小的在最上面
384
384
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
392
392
} ) ;
393
393
}
394
394
}
395
395
396
396
//创建盘子
397
397
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' ) ) ;
407
407
408
408
Hnt . A . push ( '.bl' + position . order ) ;
409
409
}
440
440
//初始化
441
441
$ ( '#init' ) . click ( function ( ) {
442
442
Hnt . initBlock ( $ ( '#num' ) . val ( ) ) ;
443
- } ) ;
444
-
443
+ } ) ;
444
+
445
445
//数字正则
446
446
var regx = / [ 1 - 9 ] + [ 0 - 9 ] * / g
447
447
//改变时间
Original file line number Diff line number Diff line change 27
27
28
28
.log {width : 228px ;float : left;text-align : left;margin : 0 4px ;}
29
29
</ style >
30
- < script type ="text/javascript " src ="jquery-1.9.0 .js "> </ script >
30
+ < script type ="text/javascript " src ="jquery.min .js "> </ script >
31
31
< script type ="text/javascript " src ="hanoi.js "> </ script >
32
32
< style >
33
33
# test {width : 500px ;height : 200px ;position : relative;background-color : yellow;}
You can’t perform that action at this time.
0 commit comments