jQuery.extend的用法

有網友提問,看不太懂jQuery.extend的用法,本想在留言裡回覆,但寫著寫著,發現要說到淺顯白話,還真得花些篇幅,索性另起一篇,解釋得更詳細點。

以jQuery.extend(objA, objB)為例,你可以想像成objA與objB各有一些屬性(方法也會比照處理,在此只提屬性),extend()會將objB有而objA沒有的屬性加到objA裡,如果objB裡的某個屬性,objA裡剛好也有同名的屬性,則會用objB的屬性值去覆寫objA原有的屬性。objA最後就是整合結果,或者也可以由var objC = jQuery.extend(objA, objB)取得整合結果(objA == objC)。

...繼續閱讀 »

CSS3 Backgrounds

CSS3 Backgrounds

CSS3 contains several new background properties,
which allow greater control of the background element.

In this chapter you will learn about the following background properties:

background-size
background-origin
You will also learn how to use multiple background images.

...繼續閱讀 »