????:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jQuery事件</title> &
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jQuery事件</title> <script type="text/javascript"src="jquery-3.3.1.min.js"></script> <style type="text/css"> .box{ width: 100px; height: 100px; background: pink; } </style> </head> <body> <script type="text/javascript"> $(document).ready(function () { $(document).mousemove(function(aa){ $('span').text('x: '+aa.pageX+'y: '+aa.pageY) }) $(window).resize(function(){ console.log('窗口大小被調(diào)整了') }) $('.box').mouseover(function(){ console.log('鼠標(biāo)滑過(guò)了') $('.box').css({'background':'red'}) }) $('.box').mouseout(function(){ console.log('鼠標(biāo)移開') $('.box').css({'background':'pink'}) $('.box').css({'width':'100px'}) }) $('.box').mousedown(function(){ console.log('鼠標(biāo)點(diǎn)擊下') $('.box').css({'background':'green'}) }) $('.box').mouseup(function(){ console.log('鼠標(biāo)點(diǎn)擊完') $('.box').css({'background':'blue'}) }) $('.box').click(function(){ console.log('鼠標(biāo)點(diǎn)擊') $('.box').css({'width':'200px'}) }) }) </script> <div> 當(dāng)前鼠標(biāo)位置:<span> </span> </div> <div></div> </body> </html>
之前聽到韋小寶老師說(shuō)的代碼加上高亮,不清楚是什么意思,是上面這種選好語(yǔ)言,有背景顏色嗎