KB.Driver 发表于 2024-5-11 20:30
@row_max = (@item_max / @column_max.to_f).ceil
to_f将列数转为浮点数,这样除法会得到小数。
ceil向上取 ...
if row > @item_max%@column_max>0 ? @item_max/@column_max+1 : @item_max/@column_max row=top_row-1 end
1111.png (293.19 KB, 下载次数: 15)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |