concept ability in category jQuery

appears as: ability, The ability, Ability, bility, bilities, abilities
jQuery UI in Action

This is an excerpt from Manning's book jQuery UI in Action.

  • Interactions are jQuery plugins that give the user the ability to interact with DOM elements. The draggable interaction allows users to drag elements around the screen, and the sortable interaction allows users to sort items in a list. We’ll cover interactions in chapter 5.
  • Ability to affect multiple elements —jQuery’s plugin syntax allows methods to be invoked on multiple elements at the same time. The following code converts two <div> elements to dialog widgets, and then opens them both. (The autoOpen option prevents the dialogs from automatically opening. We’ll discuss the option in more detail momentarily.)
    <div>A</div>
    <div>B</div>
    <script>
        $( "div" )
            .dialog({ autoOpen: false })
            .dialog( "open" );
    </script>
  • Figure 4.4. A menu showcasing three features of the menu widget: the ability to turn nested lists into nested menus, the ability to create dividers from empty <li> elements, and the ability to add jQuery UI icons to individual menu items.

    Although the ability to style all widgets at the same time is powerful, sometimes you don’t want changes to apply everywhere. In this example, the highlighting changes are prefixed with ui-dialog because you want the CSS rules to apply only when ui-state-highlight is used in a dialog. ui-dialog is one of many class names that jQuery UI provides for each individual widget. Next, let’s look at what class names are available and what you can do with them.

    What are those jquery-ui.structure.css and jquery-ui.theme.css files? jQuery UI breaks its CSS rules into two categories: structural (margin, width, height, and so forth) and theming (the ones you configured in ThemeRoller). These rules are placed into jquery-ui.structure.css and jquery-ui.theme.css, respectively. This gives you the ability to manage multiple themes without duplication, as jquery-ui.structure.css remains the same regardless of which theme you use. Unless you plan on managing multiple themes—and the majority of developers don’t—use jquery-ui.css, as it’s the structure and theme concatenated together.

    Extending jQuery

    This is an excerpt from Manning's book Extending jQuery.

    Today, jQuery is the most widely used JavaScript library on the web. It offers many functions to make life easier as a front-end developer, such as the ability to traverse the HTML Document Object Model (DOM) to find the elements you want to work with and apply animations to those elements. Moreover, the developers of jQuery have recognized that it can’t (and shouldn’t) do everything, and have provided extension points that allow additional functionality to be integrated into the normal jQuery processing. This foresight has contributed to its popularity.

    This chapter looks at the jQuery architecture that allows plugins to operate alongside the built-in code, and then presents a simple collection plugin (one that operates on a set of selected elements) to show what can be done. The remaining chapters examine each extension point in detail, explain how to use them to enhance jQuery’s abilities, and present a set of guiding principles and best practices for developing your plugins.