开发者

How to create automated tabs in html/php

开发者 https://www.devze.com 2023-03-06 21:36 出处:网络
I could not find a good tutorial for how to generate tabs in html page. I would like to create a function that automatically generates a tab from database information.

I could not find a good tutorial for how to generate tabs in html page. I would like to create a function that automatically generates a tab from database information.

I was thinking something along these lines.

    开发者_开发技巧
  1. Get categories from DB.

  2. IF(!EMPTY(gategory))

{ create a new tab, named after the category. }

Could somebody please link me to a good tutorial or maybe give an example. Thank you.


Well, you know PHP is a server-side technology and there's no way for creating tabs in the client-side without JavaScript help!

In that case, check jQuery UI / Tabs:

  • http://jqueryui.com/demos/tabs/

You'll need to initialize your script by forming some JSON and iterating an array of tabs information so you should have enough for creating the whole markup that jQuery UI tabs needs in order to get initialized.

0

精彩评论

暂无评论...
验证码 换一张
取 消