我在一个页面中有超过10个按钮,所以我只需要编写一次代码来悬停.因为这个我使用jQuery.请仔细检查我的代码.
$(document).ready(function(){
$('.button').hover(function(){
var bc=$(this).css('background-color');
var cl=$(this).css('color');
$(this).css('background-color',cl);
$(this).css('color',bc);
});
});Run Code Online (Sandbox Code Playgroud)
.button {
color: #FFFFFF;
text-align: center;
font-size: 22px;
height:70px;
width: 160px;
margin: 5px;
transition: all 0.5s;
margin-right:30px;
}
.button:hover{
transform: scale(1.1);
}Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
</script>
</head>
<body>
<button class="button" style="background-color: red;">Hover </button>
<button class="button" style="background-color: green;">Hover </button>
<button class="button" style="background-color: blue;">Hover </button>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
如果我们连续悬停在按钮上意味着它会改变颜色,那么它是否可以通过单个悬停工作正常,如果有任何其他方法可以避免这种情况?颜色应保持不变.
我在Node.js中有一个简单的"Hello World"程序.我想使用批处理文件运行它.
var http=require("http");
http.createServer(function(request,response){
response.writeHead(200,{'Content-Type':'text/plain'});
response.end('Hello World!..\n');
}).listen(8080);
console.log('Server running at http://127.0.0.1:8080/');Run Code Online (Sandbox Code Playgroud)
if not "%minimized%"=="" goto :minimized
set minimized=true
@echo off
start /min cmd /c "C:\Users\USER2\Desktop\webchat\server.js"
goto :EOF
:minimized
Run Code Online (Sandbox Code Playgroud)
请帮我.