TAILIEUCHUNG - JQuery: Novice to Ninja- P27

JQuery: Novice to Ninja- P27:No matter what kind of ninja you are—a cooking ninja, a corporate lawyer ninja, or an actual ninja ninja—virtuosity lies in first mastering the basic tools of the trade. Once conquered, it’s then up to the full-fledged ninja to apply that knowledge in creative and inventive ways. | Plugins Themes and Advanced Topics 367 Attach our data object to the JavaScript pin object locator .data pin_datal locationData Now at a future point when the user clicks on the map and the locator s click handler fires we ll have access to the locationData object Later when a location is clicked. var currentData clickedLocation .data pin_data We can retrieve the metadata stored on the object alert You selected the location Although in many cases we d probably want to store the element reference in the object itself when the objects are coming from third-party code you have to be very careful with adding or removing properties. As well since any changes the third party makes in the future could affect your code it s best to play it safe. The data action lets us augment the object without changing it. Theme Rolling Throughout the preceding pages we ve traversed and conquered much of the jQuery UI API. One of the most attractive features of jQuery UI is . its attractiveness Out of the box the UI components look great and as much as we might hate to admit it looking great is incredibly important. Sometimes it can be even more important than the functionality itself There s nothing worse than showing a colleague or boss a technically brilliant proof of concept for a control you ve created only to be met with criticism about its design. Worse still sometimes your lack of initial thought regarding skinning and theming results in a product that s inherently difficult to style. This is not a problem for jQuery UI components there s a gallery of themes avail-able and picking or customizing a new funky design is simple thanks to the ThemeRoller web ThemeRoller lets you tweak design and download jQuery UI themes. Additionally if you follow some simple conventions when creating your own controls you can easily take advantage of existing and customized themes to ensure everything you create looks as awesome as it works. 1 http .

16    4    0    12-08-2020
8    6    0    12-08-2020
10    6    0    12-08-2020
3    3    0    12-08-2020
118    3    0    12-08-2020
22    10    0    12-08-2020