Datatables - Show only input box on table load

I am currently working on a website which includes using Datatables. After customizing a lot, it looks quite like a regular SERP. **The feature I want to implement:** On page load only the input box should be displayed and the data rows should be hidden until a search string is entered. So it actually should behave like you see it on known Search engines. I didn't find info about on datatables' forum or here. It tried using *jQuery keypress() but it did not worked*. I tried hiding the table on keypress, didn't worked at all (just to get started). $("#inputbox").keypress(function () { $("table.display").css("display":"none"); }); But toggle works fine: $("#button").click(function () { $("table.display").slideToggle(); }); So the problem is somehow with the input box and the keypress function I guess. Would be really glad to get some feedback here.

以上就是Datatables - Show only input box on table load的详细内容,更多请关注web前端其它相关文章!

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

评论 抢沙发

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

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

联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏