我想要实现的目标:当我的鼠标移动时,然后执行此操作,但是当它停止移动大约半秒时,然后执行此操作,但当它再次开始移动时,然后执行此操作。这是我的临时 jQuery:
$(document).ready(function() {
$('.test').mouseenter(function(){
$(this).mousemove(function(){
$(this).css({
'background-color' : '#666',
'cursor' : 'none'
});
});
});
$('.test').mouseout(function(){
$(this).css({
'background-color' : '#777',
'cursor' : 'default'
});
});
});
Run Code Online (Sandbox Code Playgroud)
我完全不知道该怎么做,基本上我的代码是这样做的:当你用鼠标输入一个元素并且你的鼠标在该元素内移动时,然后应用这个 CSS,当你的鼠标离开该元素时,然后应用这个 CSS,但是当鼠标位于该元素内并且它停止移动一段时间时,请执行此操作<-我无法弄清楚最后一点。
我正在尝试在 ubuntu 上安装 node-sass,因为我想使用 sass-autocompile,但即使我尝试在atom中编译该 sass 文件(就在我保存它时),它也会返回此错误:
`fs.js:904
return binding.readdir(pathModule._makeLong(path), options.encoding)
Error: ENOENT: no such file or directory, scandir
'/usr/lib/node_modules/node-sass/vendor'
at Object.fs.readdirSync (fs.js:904:18)
at Object.getInstalledBinaries (/usr/lib/node_modules/node-
sass/lib/extensions.js:129:13)
at foundBinariesList (/usr/lib/node_modules/node-
sass/lib/errors.js:20:15)
at foundBinaries (/usr/lib/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/usr/lib/node_modules/node-
sass/lib/errors.js:45:5)
at module.exports (/usr/lib/node_modules/node-sass/lib/binding.js:15:30)
at Object.<anonymous> (/usr/lib/node_modules/node-
sass/lib/index.js:14:35)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)`
Run Code Online (Sandbox Code Playgroud)
我尝试使用此命令npm rebuild node-sass,但它没有解决问题,即使使用--force
删除nodejs、node-sass和npm并再次安装并没有解决问题,是的,我确实安装了ruby。
但有一件事真的很奇怪:这条路径node_modules/node-sass/vendor'存在于主文件夹中,基本上node_modules存在于主文件夹中,即使与该供应商文件夹也是如此。你能帮我吗 ?
所以...到目前为止我一直使用 Atom,我想尝试 PhpStorm,但我遇到了 HTML 标签的问题。
PhpStorm 是如何做到的:
如果你想自动完成 HTML 标签,你必须输入例如。<d出现自动完成菜单后,按 Enter -> 它会自动完成<div,如果你想关闭它,你必须输入>和繁荣你有<div><\div>。
Atom 是如何做到的(我想要的方式):
但是在 Atom 中,您只需键入di并显示自动完成菜单,如果您按 Enter,它会自动自动完成并自动将其关闭为<div></div>.
最后的问题:
是否可以像在 Atom 中一样实现它?只是不需要在第一个标签<的开头和>结尾输入?
所以我有这个简单的jQuery ajax函数,但它是内部each函数,因为它在网站上的每个帖子里面
$('.post .button').each(function() {
$(this).click(function() {
$.ajax({
url: 'action/update.php',
type: 'POST',
data: {
postID: $(this).closest('.container').find('.postID').val()
},
success: function() {
$(this).css({'color' : 'green'});
}
});
});
Run Code Online (Sandbox Code Playgroud)
});
但是在成功之后我想要更改已被点击的元素的一些css.基本上我想发布这个,而不需要使用基本的html帖子刷新网站.它甚至可能吗?你能帮我吗?
我在PHP中的代码很长,我希望通过创建一个具有不同值的函数来缩短它,而不是只编写一行函数名而不是多行代码,但它似乎不起作用.
这就是重复代码:
if (!isset($_POST['ID_user']) || empty($_POST['ID_user'])) {
$_SESSION['ID_user_missing'] = "error";
header("location: index.php");
} else {
$ID_user = $_POST['ID_user'];
}
if (!isset($_POST['meta_name']) || empty($_POST['meta_name'])) {
$_SESSION['meta_name_missing'] = "error";
header("location: index.php");
} else {
$meta_name = $_POST['ID_user'];
}
if (!isset($_POST['meta_value']) || empty($_POST['meta_value'])) {
$_SESSION['meta_value_missing'] = "error";
header("location: index.php");
} else {
$meta_value = $_POST['meta_value'];
}
Run Code Online (Sandbox Code Playgroud)
这是计划,而不是那个代码,我只会在下面有这个:
function ifIssetPost($value) {
if (!isset($_POST[$value]) || empty($_POST[$value])) {
$_SESSION[$value.'_chybi'] = "error";
header("location: index.php");
} else {
$$value = $_POST[$value];
}
}
ifIssetPost('ID_user');
ifIssetPost('meta_name');
ifIssetPost('meta_value');
Run Code Online (Sandbox Code Playgroud)
但它只是不起作用,当你尝试回$meta_name …