Web Development with jQuery®

(Elliott) #1

Summary (^) ❘ 175
Finally, these methods were reiterated with a real-world-oriented example that shows you how to
replace the browser’s default context menu with your own. In this situation, you want to use jQue-
ry’s css() method to set CSS property values, rather than a style sheet, because the values set are set
dynamically.
EXERCISES



  1. What script would you use if you want to obtain the value of the color property for a


element using jQuery?



  1. If you want to set the background color of a web page using jQuery, what code would


you use?



  1. If you need to set padding, a margin, and a border on a set of
    elements using jQuery,


what would the code look like?



  1. What is the jQuery method that returns an element’s pixel width including border and padding


dimensions called?



  1. If you wanted to obtain a
    element’s pixel height including a border, padding, and


margins using jQuery, what would the code look like?


http://www.it-ebooks.info

Free download pdf