摘要:jQuery獲取/改變CSSjQuery操作屬性的方法jQuery事件方法jQuery事件切換:hover(over,out)鼠標(biāo)移上效果和鼠標(biāo)移出效果。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/
jQuery獲取/改變CSS
jQuery操作屬性的方法
jQuery事件方法
jQuery事件切換:hover(over,out)鼠標(biāo)移上效果和鼠標(biāo)移出效果。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標(biāo)題文檔</title> </head> <script type="text/javascript" src="jquery-3.4.0.min.js"> </script> <style type="text/css"> div{width:200px;height:200px;border:1px solid #0F0} </style> <body> <script type="text/javascript"> $(document).ready(function(){ $('div').hover( function(){ $(this).css('background','red') }, function(){ $(this).css('background','blue') } ) }) </script> <div>我是內(nèi)容</div> </body> </html>
批改老師:天蓬老師批改時(shí)間:2019-04-13 16:38:36
老師總結(jié):在js中, this是誰, 一直是一個(gè)難點(diǎn), 也是一個(gè)重點(diǎn)? 想一下, 在本例中, 它是誰, 其實(shí)就是上下文