我在我的网站上使用滚动到顶部按钮。我正在使用这个 Jquery
$(window).scroll(function() {
if ($(this).scrollTop()) {
$('#cttm:hidden').stop(true, true).fadeIn();
} else {
$('#cttm').stop(true, true).fadeOut();
}
});
$(document).ready(function(){
var bottom = ($(window).outerHeight() - $(window).height()) - 150; // 150 pixel to the bottom of the page;
$(window).scroll(function(){
if ($(window).scrollTop() >= bottom ) {
$("#cttm").fadeTo("slow",.95);
} else {
$("#cttm").fadeOut("slow");
}
});
$("#cttm").click(function(){
$('html, body').animate({scrollTop:0}, 'slow');
$("#cttm").fadeOut("slow");
});
});
Run Code Online (Sandbox Code Playgroud)
这个 Jquery 效果很好,但我希望元素只在我们从顶部滚动到 200px 或类似的东西时出现。有没有办法用 JQuery 做到这一点?
我正在为 WordPress 网站使用 Easyengine,我需要将一个大文件上传到服务器,我知道我可以使用 FTP / SSH 来执行此操作,但从长远来看,我需要通过 PHP 来完成,并且当前上传我看到的限制是100M做时phpinfo();
该设置使用 PHP 7,我找到的 PHPINI文件位于
etc/php/7.2/php.ini
我对这些部分进行了更改:
upload_max_filesize = 2100M
post_max_size = 2100M
Run Code Online (Sandbox Code Playgroud)
但即使在此之后,上传限制仍为 100M,正如我在我正在使用的 WordPress 插件页面以及与phpinfo()
我在某处读到 Nginx 需要重新启动,所以我这样做了,ee site restart example.comNginx 和 PHP 都重新启动了仍然没有效果。
一些文章建议添加一条规则,/etc/nginx/nginx.conf但不幸的是该路径甚至不存在,因此我在该路径创建了该文件并尝试但仍然没有用。
如果..else条件简短,是否有办法使以下JavaScript简短,而不是if() else()两次编写函数,没有任何方法可以写,if(x,y = ""){} else{}也可以通过类似的方法使它更短?
$(document).ready(function(){
$("#third").click(function(){
var xxx = $("#first").val();
var xxy = $("#second").val();
if (xxx == "") {
alert("good");
}
else {
alert("bad");
}
if (xxy == "") {
alert("good");
}
else {
alert("bad");
}
});
});
Run Code Online (Sandbox Code Playgroud)