如何让鼠标移动到div块上就触发JS?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:57
Original
1483 people have browsed it

主 页




这句话里,只有将鼠标移动到“主页”这两个字,就是链接上时才会有动作。

如何移动到div上就有效果啊?


回复讨论(解决方案)

a链接的区域大小就是其里面的文字显示区域的大小。把onmouseover写成div的事件不就得了。

a放在div里。

onmouseover写成div的

你这个没有说清楚哪个DIV而且代码的顺序是怎么样的。

用jQuery,给目标div设个id,然后执行$("#id").hover(function(){},funtion(){})这条语句

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!