JQuery learning note2

  1. $(function() {
  2.             $('a').click(function() {
  3.                 $('#box').toggle();
  4.         $('#box').toggle(3000);
  5.         $('#box').toggle('slow');
  6.         // you must define the '.border' class firstly in css. Then, this can apply or remove the toggle class alternatively.
  7.         $('#box').toggleClass('border');
  8.             });
  9.         });
  10. $(function() {
  11.         // set the opacity to 0.5 when the document is ready            
  12.             $('#container div').animate({ "opacity": .5 });
  13.             $('#container div').hover(function() {
  14.             // add the hover function
  15.                 $(this).stop().animate({ "opacity": 1 });
  16.             }, function() {
  17.         // add hover finish function.
  18.                 $(this).stop().animate({ "opacity": .5 });
  19.             });
  20.         });
  21. $(function() {
  22.         // when the user click the anchor and trigger the event, it will request the MoviePage.htm and select #movies's content
  23.         // after response it will trigger the callback function for the following thing. such as append and slideDown...
  24.             $('a').click(function() {
  25.             $('<div id="info" />').load('MoviePage.htm #movies'function() {
  26.                     $(this).hide().appendTo('#container').slideDown(1000)
  27.                 });
  28.             });
  29.         });
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值