开发者

jQuery Tabs - Adding reusable next/previous buttons

开发者 https://www.devze.com 2023-02-08 06:18 出处:网络
Im looking to extend the jquery tabs to add next and previous buttons - which i have done using the s开发者_运维百科how event. The problem is that its a big chunk of code added to that event for each

Im looking to extend the jquery tabs to add next and previous buttons - which i have done using the s开发者_运维百科how event. The problem is that its a big chunk of code added to that event for each page that needs tabs and these buttons. How i go about making it a reusable component?

David


Write a jquery plugin to wire your tabs up by convention. Here's a tutorial: http://docs.jquery.com/Plugins/Authoring

Decorate your tab list with something like , then have your plugin pick up on ul's with class "scrollable". Write all your logic in there. You shouldn't need to call any function explicitly for each page.

0

精彩评论

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