Jquery cPanel Css警报
如何在页面顶部创建自动解除css警报,如cPanel警报绿色、蓝色、红色。使用移动媒体查询,您可以在移动设备上隐藏加载程序的内容 您还需要将文本内容分组到加载器中,以便更容易隐藏它Jquery cPanel Css警报,jquery,html,css,Jquery,Html,Css,如何在页面顶部创建自动解除css警报,如cPanel警报绿色、蓝色、红色。使用移动媒体查询,您可以在移动设备上隐藏加载程序的内容 您还需要将文本内容分组到加载器中,以便更容易隐藏它 @media(max-width:421px) { #text-group { display: none; } } 上面的代码检查屏幕宽度是否小于500px(u可以使用任何值),然后隐藏加载程序的内容 这个答案会给你一个起点 以全屏模式打开代码段并减小屏幕大小 /*对于桌面,无需添加媒体查询*/
@media(max-width:421px) {
#text-group {
display: none;
}
}
上面的代码检查屏幕宽度是否小于500px(u可以使用任何值),然后隐藏加载程序的内容
这个答案会给你一个起点
以全屏模式打开代码段并减小屏幕大小
/*对于桌面,无需添加媒体查询*/
/*把你的风格放在这里*/
/*对于桌面,它采用上述样式*/
/*移动电话*/
/*你需要隐藏文本组*/
@介质(最大宽度:421px){
#文本组{
显示:无;
}
}
这里是Gif
请稍候
请稍候。。。这需要一秒钟
以下是我对解决方案的看法。我只会在我觉得我所做的和你所展示的在某些方面有所不同的地方发表评论
首先,我的示例使用引导和Jquery,因此下面几行位于顶部
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.js">
</script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
当屏幕小于420px时:
登录
请稍候
请稍候。。。这需要一秒钟
另外请注意,使用此设置,“加载”部分在屏幕调整大小时垂直和水平居中。@John\u Cartor无论您想在移动或更小的设备上隐藏什么,请将其放在微调器文本中
/*FOR MOBILE*/
@media only screen and (max-width:420px)
{
#dst{display:none;}
#loading{
width: 175px;
height: 150px;
}
}
/*FOR DESKTOP*/
@media only screen and(min-width:421px)
{
#dst{display:initial;}
}
<script type="text/javascript">
$(function()
{
$("#btnSignin").on("click", function()
{
spinner();
});
});
function spinner()
{
$('#overlay').toggle();
}
</script>
#overlay
{
display: none;
position: fixed;
top: 0;
left: 100;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
z-index: 2;
cursor: wait;
}
#loading
{
border:1px solid #f5ba1a;
padding: 0px;
margin: auto;
width: 410px;
height: 150px;
background: rgb( 255, 255, 255) url('https://image.ibb.co/dCLkxo/IMG_20180607_072610_027.jpg') 0px 50% no-repeat;
position: absolute;
z-index: 3;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#ntf, #h4
{
color: #d80;
}
#dst
{
width: 100%;
height: 100%;
margin: 0 auto;
z-index: 4;
padding-left: 160px;
padding-right: 5px;
}
<button class="button" id="btnSignin">Sign In</button>
<div class="container">
<div id="overlay">
<div id="loading">
<div id="dst">
<h4 id="h4">Please Wait!</h4>
<p id="ntf">Please wait... it will take a second!</p>
</div>
</div>
</div>
</div>