我用这个代码,以确定复选框,宽度和高度:与复选框填充的div
var chk = $('input[type="checkbox"]:first');
chkWidth = chk.innerWidth()
+ parseInt(chk.css('margin-left').replace('px', ''))
+ parseInt(chk.css('margin-right').replace('px', '')); /*IS there better way instead of px replace?? */
chkHeight = chk.innerHeight()
+ parseInt(chk.css('margin-top').replace('px', ''))
+ parseInt(chk.css('margin-bottom').replace('px', ''));
fieldWidth = gamefield.innerWidth();
fieldHeight = gamefield.innerHeight();
然后我试图填补DIV与恰好适合给定格复选框的数量。事实上,我得到了很多复选框。
反正是有解决这个问题?谢谢!
是什么填充DIV的代码? – TheVillageIdiot 2010-03-04 19:06:52
http://dl.dropbox.com/u/3473965/jq/tetris.js – Overdose 2010-03-04 19:07:56
愚蠢无关的问题,复选框如何与俄罗斯方块联系起来?谢谢。 – smaclell 2010-03-04 19:32:20