Tìm hiểu Jquery 1
Posted by thinhnv2 on June 27, 2012
Bài tập 1:
Download index.html file (http://www.mediafire.com/?k7rk5k35xerd01e) and perform the following tasks.
Add a class of special to all of the <li> elements at the second level of the
2. Add a class of year to all of the table cells in the third column of a table.
3. Add the class special to the first table row that has the word Tragedy in it.
4. Challenge: Select all of the list items (<li>s) containing a link (<a>). Add the
class afterlink to the sibling list items that follow the ones selected.
5.Challenge: Add the class tragedy to the closest ancestor <ul> of any .pdf link.
Bài tập 2:
Download file http://www.mediafire.com/?ambko3nper2nfbm and perform the following task:
1. When Charles Dickens is clicked, apply the
selected style to it.
2. When a chapter title (<h3 class=”chapter-title”>) is double-clicked, toggle the visibility of the chapter text.
3.When the user presses the right arrow key, cycle to the next body class. Thekey code for the right arrow key is39.
4. Challenge: Use the console.log() function to log the coordinates of the mouse as it moves across any paragraph. (Note: console.log() displays its results via the Firebug extension for Firefox, Safari’s Web Inspector, or the Developer Tools in Chrome).
5. Challenge: Use .mousedown() and .mouseup() to track mouse events anywhere on the page. If the mouse button is released above where it was pressed, then add the hidden class to all paragraphs. If it is released below where it was pressed, then remove the hidden class from all paragraphs.