jQuery选项卡wdScrollTab

 http://dl2.iteye.com/upload/attachment/0122/8474/f1629778-e2a9-3ecc-a966-d1c77b0eda51.jpg 

实例Demo

运行一下

参数说明

 

Config

active

Number   Active tab index. Base on 0.

autoResizable

Boolean   Whether panel resizes itself according to content.

border

Boolean   To show border or not.

height

String   Initialization height.

  1. //heigh config
  2. height:'200px'// or '100%'.

复制

heightResizable

Booean   Whether end user can change panel height by mouse dragging.

items

Array   Tab items array.

renderTo

String or JQuery object   To specify where tab panel will be placed. It could be a DOM id or jquery object.

width

String   Initialization width.

  1. // width config, in px or percentage.
  2. width:'200px'// or '100%'.

复制

widthResizable

Boolean   Whether end user can change panel width by mouse dragging.

Method

addTab(item)

To add a new tab.

ObjectitemObject for item profile.
  1. //to add a new tab
  2. addTab({id:"newtabid",
  3. title:"I am new",
  4. html:"some new message goes here",
  5. closable:true,
  6. disabled:false,
  7. icon:"image/new.gif"
  8. });

复制

getActiveIndex()

To get index of active tab.

Return Number - index of active tab.

getActiveTab()

To get active tab.

Return Object - Profile of active tab.

getClosable(id)

To determine whether tab is closable or not.

Stringiditem id.

getContent(id)

To get tab inner html.

Stringiditem id.

getDisable(id)

To determine whether tab is disabled or not.

Stringiditem id.

getTabPosision(id)

To get tab index.

Return Number - index of tab.

Stringiditem id.

getTabsCount()

To get how many tabs are in the panel.

Return Number - Number of tabs .

getTitle(id)

To get tab title.

Stringiditem id.

kill(id)

To close tab.

Stringiditem id.

refresh(id)

To refresh tab content.

Stringiditem id.

setClosable(id,  True)

To enable or disable end user to close tab.

StringidItem id.
BooleaanTruefor closable, false for not.

setContent(id,  title)

To set tab title.

StringidItem id.
StringtitleTab inner html.

setDisable(id,  True)

To enable or disable tab.

StringidItem id.
BooleaanTruefor disabled, false for enabled.

setRenderWH(wh)

To set width and height of the panel.

Objectwhwidth and height.
  1. //To set tab height and width
  2. setRenderWH({width:'200px',height:'400px'});

复制

setTitle(id,  title)

To set tab title.

StringidItem id.
StringtitleTab title.

下载

相关推荐