Style issues in JQuery plug-in writing

Source: Internet
Author: User

To create a jQuery Tabs plug-in, the tabs plug-in jQuery UI is too complicated and the style is not easy to adjust.

Non-plug-in writing:

Var tabs = {
Init: function (){},
Hide: function (I) {display the first tab },
Show: function (I) {hide the tabs}
};

I don't know how to write the jQuery plug-in? This form: $ ('# tab'). tabs. init ()

Now I only know how to write a single function as follows:

(Function ($ ){
$. Fn. plugin = function (s ){
// Code...
};
}) (JQuery );

JQuery. fn. extend ({
});
$ ('# Tab'). tabs. init () // In your form, is tabs an object? JQuery object?
Tabs objects include init, hide, show... and other methods. Are these methods used to hide all tabs directly or a certain tab?
I don't want to develop plug-ins myself because of the complexity of the ui. I think the ui is very useful. If you want to change the style, use firebug debugging or read the manual on the official website.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.