17

jQuery: A sua Biblioteca JavaScript

Embed Size (px)

DESCRIPTION

Com 200 exemplos, alguns executáveis online, esta obra é essencial para se iniciar nesta tecnologia e aprender a relacioná-la com HTML, HTTP, JavaScript, Ajax e CSS. Para programadores e webdesigners.

Citation preview

������������

�����������������

���������������� ������������

������������������� ������������������������������� !����"��#�$������������%�& '"�" �&()& *&�+�����'�*�#�$������������%�"'�*�)& *&�+��,�"-�./��0�"1� �2#�$������������%��"-�3��)& *&�+����-�"1� �2)& *&�+����� ����4�25����(+�"��./�#�$����������$�%�*+ ��"��3 ���&)& *&�+��,�(#�$����$�$6����

�������� ����� !#�!'��7"� ��*��8 �9" ������%������$������� !�%�:&�#�$��������������-� &#�& '"�" �&()& *&�+��7 �: #���5����- /��*�;9 �����$�%������$$��7�"���%�:&�#�$$�������������-� &#�*&+�"��)& *&�+��

��+<" 2=��>�?�� "��$����

,�!�%��* ��"��*����"-@� 3����*���

���A#�������$��$$�������

��+�#��-4& ����&.�*��

�-+"��/����3�B�-���#�: +�2"� ����5��������*���%���5�/�

�+9� ����2�&�A�C���������$�

�������

����+ 3��2"�-��-"3�5-��(+& 3�./��� ��5�+"�+9� ���D��&"��"���& ��"�+�"�����-�.��E5�"+"�����+�"����5�5"��*���3" ������-�*�-������@"��*��* ./���D3� 3���5� '"� �@" �����*��'�&' -����-��� '��*�� ���39+ ��� ��9* 2��*��� " ���*�!5��"� ���B&3�E5�D� 3" -�+5� *�� +�"� & �� �� ���39+ �� �-� �5��" F�./�� *��� +"�+" �@" ��� *�� ��������� A�� �������� ����+"@� 3�� 2�"�& F�5��� ��B"�5*�� ��� �� ��� �5+" �"�� +"�'�3��*�� 5-�� E5*�� �5B����3 �&� ���3�-+"�� *� & '"��� �D3� 3���� !�� -�� �5-� +�4�� -� E5� �� & �"��5"�� �D3� 3�� D� �/�� �3������ ����5��"���/�����-�-�� '�./��+�"��3" �"��B"��� �D* ������FG�&���+5B& 3�"�� 3��*�����& ��"�� -+��� B & ��*���*��"�B B& �2"� ��-�+�"�525G����-B"�-���+�"�������E5�D�(+"���-���+"� B *����"+"�*5./��������*���5�-�+�"���*��+"�����B"���-��5��" F�./��*��* ��"���

0�"3����2 ���*���*�,�!�%��* ��"��*����"-@� 3����*����%���

�� ���

web jQuery.pdf 1 18-01-2013 8:14:52

>>��,,��!!��%%����** ����""����**��������""--@@�� 33����

HHAA����������;;����!!������

���� ������������������������������������������������������������������������������������������������������������

��� ���������������������������������������������������������������������������������������������������������

���� ��������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������

���� ���������� �� ����� ��������������������������������������������������������������������������������������������������������������������� ��������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������ � �� � !"��������������������������������������������������������������������������������������������������������������������������������������������������#� $�%����������������������������������������������������������������������������������������������������������������������������������������������� ���&� ���� �'�!(���������������������������������������������������������������������������������������������������������������������������������������#���)� $���������������������������������������������������������������������������������������������������������������������������������������������������������&�

�������� �������������������������������������������������������������������������������������������������������

���� �����*���+,��-.�����������������������������������������������������������������������������������������������������������������������������������/����� �� ������������������������������������������������������������������������������������������������������������������������������������������������������������ ����������������������������������������������������������������������������������������������������������������������������������������������������������������� 0�%�������1���������2���$��������������������������������������������������������������������������������������������������������������

������ 3����4������%�%��������2���$����.������������������������������������������������������������������������������������������������ 5����6������%�%�������2���$����������������������������������������������������������������������������������������������#�

�� � 3����4��������+,��-.��������������������������������������������������������������������������������������������������������������������������&��� ��� 3���������������������������������������������������������������������������������������������������������������������������������������/��� ��� 7����������������������������������������������������������������������������������������������������������������������������������������� ��� $���!(������������ ��������������������������������������������������������������������������������������������� ��� $����������������������������������������������������������������������������������������������������������������������������������� �

��#� 0�%�������������� �������������������������������������������������������������������������������������������������������������������#���&� �����������������������������������������������������������������������������������������������������������������������������������������&���)� 7���� �������� ������ ���������������������������������������������������������������������������������������������������������&�

��)��� 5���������������������������������������������������������������������������������������������������������������������������������������������&���)��� ����������������������������������������������������������������������������������������������������������������������������������������������)���)��� 8�����9������������������������������������������������������������������������������������������������������������������������������������������

��/� 5���4 �����������'�!(����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

�����������������������������������������������������������������������������������������������������������������

���� : ����(�����+,��-���������������������������������������������������������������������������������������������������������������������������������������� ���+�� ������������������������������������������������������������������������������������������������������������������������������������� ���+�� ������ �������������������������������������������������������������������������������������������������������������������� �

���� ��������������������������������������������������������������������������������������������������������������������������������������#�

web jQuery.pdf 2 18-01-2013 8:14:52

� IIJJKK����LL##��!!����KK!!������������ ::����!!��II!!88!!��������77::��

>>��,,��!!��%%����** ����""����**��������""--@@�� 33����

8��

���� ��;�����;���+,��-����������������������������������������������������������������������������������������������������������������������������������#����� ��� ������������������������������������������������������������������������������������������������������������������������������������&��� � ���<�%����=���������������������������������������������������������������������������������������������������������������������������������������������)���#� : ����!"��+,��-����������������������������������������������������������������������������������������������������������������������������������/�

��#��� >*������������������������������������������������������������������������������������������������������������������������������������������������#��� 7� !"�������������������������������������������������������������������������������������������������������������������������������������������

��&� ������������������������������������������������������������������������������������������������������������������������������������������������������������)� $���������������������������������������������������������������������������������������������������������������������������������������������������������

��)��� 5����6�����������������������������������������������������������������������������������������������������������������������������#���)��� �;� �� �������!"������������������������������������������������������������������������������������������������������������)�

��/� ��������������������������������������������������������������������������������������������������������������������������������������������������������/������� ������������������������������������������������������������������������������������������������������������������������������������������������������ �������?������������������������������������������������������������������������������������������������������������������������������������������������ ��

������� @�������������������������������������������������������������������������������������������������������������������������������������������� ��������� 3�������������������������������������������������������������������������������������������������������������������������������������� ��������� !"�������������������������������������������������������������������������������������������������������������������������������������������� �������� �������#������3:��������������������������������������������������������������������������������������������������������������������� #������ � 7� !"���������������������������������������������������������������������������������������������������������������������������� &�

������3:�+,��-��������������������������������������������������������������������������������������������������������������������������������������������� /������8�����9���������������������������������������������������������������������������������������������������������������������������������������������������#��

������� $���������������������������������������������������������������������������������������������������������������������������������������������#��������� %��������������������������������������������������������������������������������������������������������������������������������������������#��������� %�����������������������������������������������������������������������������������������������������������������������������������#��

������������������������������������������������������������������������������������������������������������������������������������������������������������# ���� �5������������ �������������������������������������������������������������������������������������������������������������������������������#&�

��� ���������������������������������������������������������������������������������������������������������������� ��

���� A���������������������������������������������������������������������������������������������������������������������������������������������������#/����� A����������������������������������������������������������������������������������������������������������������������������������������������������&������ A������� �"�����������������������������������������������������������������������������������������������������������������������������������&������ A�������!"���������������������������������������������������������������������������������������������������������������������������������������&���� � A����������������������������������������������������������������������������������������������������������������������������������������������������&#���#� ������������������������������������������������������������������������������������������������������������������������������������������������������&#���&� 5������������ ������������������������������������������������������������������������������������������������������������������������������&&�

!������������������������������������������������������������������������������������������������������������������"��

���� >�������%+�� �������������������������������������������������������������������������������������������������������������������������������&/����� B;� �����%����� �C����������������������������������������������������������������������������������������������������������������������)��

������ 5�� �������������������������������������������������������������������������������������������������������������������������������������)�������� ?���������������������������������������������������������������������������������������������������������������������������������������������)��

���� ������ ����� ������������������������������������������������������������������������������������������������������������������������������)�������� �������� ���������������������������������������������������������������������������������������������������������������������������) ������� � ������ �����������������������������������������������������������������������������������������������������������������������) ������� : ������ ����������������������������������������������������������������������������������������������������������������������))�

���� >������ ������������������������������������������������������������������������������������������������������������������������������������/��

web jQuery.pdf 3 18-01-2013 8:14:52

� HHAA����������;;����!!������

>>��,,��!!��%%����** ����""����**��������""--@@�� 33����

8���

�� � �������� ��������������������������������������������������������������������������������������������������������������������������������/����#� ����%����D����������������������������������������������������������������������������������������������������������������������/��

��#��� 3�������������������������������������������������������������������������������������������������������������������������������������/����#��� ����%���������������������������������������������������������������������������������������������������������������������������������������/����#��� B���������������������������������������������������������������������������������������������������������������������������������������������/��

��&� 7�����9�����������������������������������������������������������������������������������������������������������������������������������������������/#���&��� E��������������������������������������������������������������������������������������������������������������������������������������������/#���&��� 5���������� �������������������������������������������������������������������������������������������������������������������/&���&��� >� ����!(������ �������������������������������������������������������������������������������������������������/)�

��)� ������������������������������������������������������������������������������������������������������������������������������������������������������/)���/� 5������������ ���������������������������������������������������������������������������������������������������������������������������������

#����������������������������������������������������������������������������������������������������������������

��� ?�� ��!"��������%��������������������������������������������������������������������������������������������������������������������������� ����� 09����������������������������������������������������������������������������������������������������������������������������������������������� ����� &���������������������������������������������������������������������������������������������������������������������������������������������� � ����� $�����������������������������������������������������������������������������������������������������������������������������������������������#�

��� � ���!"����� ���'����������������������������������������������������������������������������������������������������������������������#� ��� '����������������������������������������������������������������������������������������������������������������������������������������������������������/� ��� �����������!(���������������������������������������������������������������������������������������������������������������������������������

����� 5���!(�����*���������������������������������������������������������������������������������������������������������� ����� 3����������� ���!(����������������������������������������������������������������������������������������������������������������� ����� 3���������� ���!(��������������������������������������������������������������������������������������������������������������������

� � ������������������������������������������������������������������������������������������������������������������������������������������������������� � �#� 5������������ ��������������������������������������������������������������������������������������������������������������������������������#�

�����������������������������������������������������������������������������������������������������������������"�

#��� >�������%+�� ���������������������������������������������������������������������������������������������������������������������������������&�#��� 3�����!(����� ���������������������������������������������������������������������������������������������������������������������������)�#��� ���%+������������������������������������������������������������������������������������������������������������������������������������������������/�#��� �3:�+,��-�����������������������������������������������������������������������������������������������������������������������������������������������#� � A��������������������������������������������������������������������������������������������������������������������������������������������������������

#� ��� ������ �������������F�������� ���G�������������������������������������������������������������������������������������������#� ��� ���������������������������������������������������������������������������������������������������������������������������������������#� ��� B�������� ����������������������������������������������������������������������������������������������������������������������������#� ��� ������ ������������������� ����;��������������������������������������������������������������������������������� �

#�#� 5� ����������������������������������������������������������������������������������������������������������������������������������������������� �#�#��� 0��"������������������������������������������������������������������������������������������������������������������������������������������&�#�#��� >���� ����������������������������������������������������������������������������������������������������������������������������������)�#�#��� 7������������������������������������������������������������������������������������������������������������������������������������������������/�

#�&� 5� ���������������������������������������������������������������������������������������������������������������������������������������������#�)� 5� ������;�����9������������������������������������������������������������������������������������������������������������������������������#�/� ������� ������� ���'�������������������������������������������������������������������������������������������������������������������#�������������������������������������������������������������������������������������������������������������������������������������������������������������#����5������������ ���������������������������������������������������������������������������������������������������������������������������������

web jQuery.pdf 4 18-01-2013 8:14:52

� IIJJKK����LL##��!!����KK!!������������ ::����!!��II!!88!!��������77::��

>>��,,��!!��%%����** ����""����**��������""--@@�� 33����

8����

"��$��������������������������������������������������������������������������������������������������������������"�

&��� >�������%+�� ���������������������������������������������������������������������������������������������������������������������������������&�&����� ���� ��� �������������������������������������������������������������������������������������������������������������������������������/�&����� $����������������������������������������������������������������������������������������������������������������������������������������&����� ������������������������������������������������������������������������������������������������������������������������������������������������&����� 7�������������������������������������������������������������������������������������������������������������������������������������

&��� �3:�+,��-�����������������������������������������������������������������������������������������������������������������������������������������������&��� ������'���������9�� ����������������������������������������������������������������������������������������������������������������������&��� $ ��� �������������������������������������������������������������������������������������������������������������������������������������������� �&� � %!(FG������������������������������������������������������������������������������������������������������������������������������������������������������&�&�#� ?����� ��������������������������������������������������������������������������������������������������������������������������������������/�&�&� 5 ����������������������������������������������������������������������������������������������������������������������������������������������� ��&�)� 7�����9���������������������������������������������������������������������������������������������������������������������������������������������� ��&�/� ������������������������������������������������������������������������������������������������������������������������������������������������������ ��&����5������������ ������������������������������������������������������������������������������������������������������������������������������� ��

%��������������������������������������������������������������������������������������������������������������##�

)��� >�������%+�� �������������������������������������������������������������������������������������������������������������������������������� �)��� 3����4�������������.��������������������������������������������������������������������������������������������������������������������������� #�)��� )��������������"�������������� ���!(���������������������������������������������������������������������������������������� &�)��� 8����������������������������������������������������������������������������������������������������������������������������������������������������� )�

)����� 3�������������� ����������������������������������������������������������������������������������������������������������������� )�)����� ������ ��������+������������������������������������������������������������������������������������������������������������������#��)����� ����������;� ��� �������������������������������������������������������������������������������������������������������������������#��

)� � ?������������������������������������������������������������������������������������������������������������������������������������������������#��)� ��� >*������������������������������������������������������������������������������������������������������������������������������������������# �)� ��� 7� !(����������������������������������������������������������������������������������������������������������������������������������������##�)� ��� ����������������������������������������������������������������������������������������������������������������������������������������������##�)� ��� $�����������������������������������������������������������������������������������������������������������������������������������������������##�

)�#� ���������������������������������������������������������������������������������������������������������������������������������������������������#&�)�&� ������������������������������������������������������������������������������������������������������������������������������������������������������#)�

����������������������������������������������������������������������������������������������������������"��

/��� B;� �����������������������������������������������������������������������������������������������������������������������������������������������&��/��� 8������������������������������������������������������������������������������������������������������������������������������������������������&��/��� E�������;�����9���������������������������������������������������������������������������������������������������������������������������������&��/��� $�%����;�����9���������+�����������������������������������������������������������������������������������������������������������&&�/� � 5 �����;��6���������+����������������������������������������������������������������������������������������������������������������������&)�/�#� >������� ���;���!"�����������������������������������������������������������������������������������������������������������������������������&/�/�&� �+������ �������������������������������������������������������������������������������������������������������������������������������)��/�)� : ���������!(������������������������������������������������������������������������������������������������������������������������)��/�/� � ���!(�����������������������������������������������������������������������������������������������������������������������������������������������)��

/�/��� ?�� ��!"��������%������������������������������������������������������������������������������������������������������������) �/�/��� ?�� ��!"����������������������������������������������������������������������������������������������������������������������������)#�/�/��� ?�� ��!"��������������������������������������������������������������������������������������������������������������������������)&�

web jQuery.pdf 5 18-01-2013 8:14:52

� HHAA����������;;����!!������

>>��,,��!!��%%����** ����""����**��������""--@@�� 33����

�M�

/���� E������'�!(�������� ��������������������������������������������������������������������������������������������������������������������)&�/������ *������������ ��������������������������������������������������������������������������������������������������������������������������))�/������ ������������� ����������������������������������������������������������������������������������������������������������������������/��

/���� ����'������������������ �������������������������������������������������������������������������������������������������������������/��/���� B����������������� ������������������������������������������������������������������������������������������������������������������/��/���� ?�%����������������������������������������������������������������������������������������������������������������������������������������/#�/���� B;� �������6����������������������������������������������������������������������������������������������������������������������������//�/�� � H���������������������������������������������������������������������������������������������������������������������������������������������/��#� B;� ���� ���� ����������������������������������������������������������������������������������������������������������������������������/��&� A������������������������������������������������������������������������������������������������������������������������������������������������������/��)� A�������������������������������������������������������������������������������������������������������������������������������������������������������

���������������� ��������������������������������������������������������������������������������������"�

����� B� �����������������������������������������������������������������������������������������������������������������������������&������ +,��-�>�%���������������������������������������������������������������������������������������������������������������������������������������)�

������� 7� ��� �����������������������������������������������������������������������������������������������������������������������������/�������� 7�����;��������������������������������������������������������������������������������������������������������������������������������������/�������� : ����(���������������������������������������������������������������������������������������������������������������������������������������������� ��������������������������������������������������������������������������������������������������������������������������������������������

����� ������������������������������������������������������������������������������������������������������������������������������������������ ����������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������#�

���I�7� ��� ������������;���� �������� ������ ��������������������������������������������������������� ����I�)�������+,��-����;�4 ������������������������������������������������������������������������������������������������������������������#�

�������������������& �� ��������������������������������������������������������������������������������

�������������������'�������(��������)������(�����*����������������������������"�

*�*�������������������������������������������������������������������������������������������������������������

���� �����������������������������������������������������������������������������������������������������������

web jQuery.pdf 6 18-01-2013 8:14:52

web jQuery.pdf 7 18-01-2013 8:14:52

web jQuery.pdf 8 18-01-2013 8:14:52

��

web jQuery.pdf 9 18-01-2013 8:14:52

��

��

��

��

��

��

��

web jQuery.pdf 10 18-01-2013 8:14:53

web jQuery.pdf 11 18-01-2013 8:14:53

web jQuery.pdf 12 18-01-2013 8:14:53

web jQuery.pdf 13 18-01-2013 8:14:53

web jQuery.pdf 14 18-01-2013 8:14:53

web jQuery.pdf 15 18-01-2013 8:14:53

��

��

web jQuery.pdf 16 18-01-2013 8:14:53