How to have css applied to an inline list before it is shown with jquery .show

Basically I am trying to create a row of 'cells' (just an image of a black square or a white square, depending on its id). The problem is that when the button is clicked, the 'row' list is generated and shown to the user for a brief period of time without the css applied, then the css is applied and it is displayed correctly. Is there any way to do this the other way around, to have the css applied, then the table shown? Css ol, li { display: inline; margin: 0 0 0 0; padding: 0 0 0 0; list-style: none; } img { margin: 0 0 0 0; padding: 0 0 0 0; } Jquery $('#generateTbl').hide(); $('#generateBtn').click(function () { showCellConfiguration(); }); var showCellConfiguration = function () { loadCells($('#numOfCells').val()); $('#generateTbl').show('slow', function () { }); } var loadCells = function (numOfCells) { for (var i = 0; i < numOfCells; i++) { $("#row").append('
  • '); } } HTML

      以上就是How to have css applied to an inline list before it is shown with jquery .show的详细内容,更多请关注web前端其它相关文章!

      赞(0) 打赏
      未经允许不得转载:web前端首页 » jQuery 答疑

      评论 抢沙发

      • 昵称 (必填)
      • 邮箱 (必填)
      • 网址

      前端开发相关广告投放 更专业 更精准

      联系我们

      觉得文章有用就打赏一下文章作者

      支付宝扫一扫打赏

      微信扫一扫打赏