- $(function() {
- $('a').click(function() {
- $('#box').toggle();
- $('#box').toggle(3000);
- $('#box').toggle('slow');
- // you must define the '.border' class firstly in css. Then, this can apply or remove the toggle class alternatively.
- $('#box').toggleClass('border');
- });
- });
- $(function() {
- // set the opacity to 0.5 when the document is ready
- $('#container div').animate({ "opacity": .5 });
- $('#container div').hover(function() {
- // add the hover function
- $(this).stop().animate({ "opacity": 1 });
- }, function() {
- // add hover finish function.
- $(this).stop().animate({ "opacity": .5 });
- });
- });
- $(function() {
- // when the user click the anchor and trigger the event, it will request the MoviePage.htm and select #movies's content
- // after response it will trigger the callback function for the following thing. such as append and slideDown...
- $('a').click(function() {
- $('<div id="info" />').load('MoviePage.htm #movies', function() {
- $(this).hide().appendTo('#container').slideDown(1000)
- });
- });
- });
JQuery learning note2
最新推荐文章于 2022-10-03 15:42:55 发布