jQuery: My First CodeTag: jQuery, introduction Category: JavaScriptpost: 20 Mar 2008 read: 843 JQuery Introduction Step By Step Tutorial - Part 3: After create simple page, we try to apply jQuery at the page. In this post, we will practice how to modify css action with jQuery. We want to modify page in order to be like this:
For this job, create a file named "myjs.js". Enter following code:
What mean? The fundamental operation in jQuery is selecting a part of the document. This is done with the $() construct. In this case, jQuery find lyric-text class. Then, jQuery inject new class named "lyric-full". This job use .addClass() method. So, we must add new class in our css, like this:
Thus, open your mycss.css. Update like this:
Point your browser to http://localhost/test/jquery/myfirstjquery.html.
| ||
| | Give Your Opinion | Recommend |
|


