Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JS-鼠标悬停时移动列表文本_Javascript_Html_Css - Fatal编程技术网

Javascript JS-鼠标悬停时移动列表文本

Javascript JS-鼠标悬停时移动列表文本,javascript,html,css,Javascript,Html,Css,我需要一些文本移动到右侧时,鼠标悬停在它,这里是我到目前为止 JS: HTML: 如果您想使用JQuery,可以这样做,也可以只使用CSS $'mainnav li'。悬停函数{ $this.css'padding-left','30px'; },功能{ $this.css'padding-left','0'; }; 李{ 过渡:所有0.3秒都容易进入; } 你好 你好1 你好2 如果您想使用JQuery,可以这样做,也可以只使用CSS $'mainnav li'。悬停函数{ $this.c

我需要一些文本移动到右侧时,鼠标悬停在它,这里是我到目前为止 JS:

HTML:

如果您想使用JQuery,可以这样做,也可以只使用CSS

$'mainnav li'。悬停函数{ $this.css'padding-left','30px'; },功能{ $this.css'padding-left','0'; }; 李{ 过渡:所有0.3秒都容易进入; } 你好 你好1 你好2 如果您想使用JQuery,可以这样做,也可以只使用CSS

$'mainnav li'。悬停函数{ $this.css'padding-left','30px'; },功能{ $this.css'padding-left','0'; }; 李{ 过渡:所有0.3秒都容易进入; } 你好 你好1 你好2
$("#mainnav li").hover(function() {
$(this).css('padding-left', '50px');});
<ul id="mainnav"> 
<li>hello</li>
<li>hello 1</li>
<li>hello 2</li>
</ul>