我试图在使用jquery的定时事件后删除div ..目前初始计时器如下.....
$(document).ready(function () {
setTimeout(function () {
$("#loader-wrapper .loader-section, #textbit").hide("slow");
$("#logo").animate({ left: '-115px', top: '-60%' });
$("#logo-side").animate({ opacity: 9 }, 2000);
$("#loader-wrapper").remove();
}, 2000);
});
Run Code Online (Sandbox Code Playgroud)
我在这里做了一些事情,在loader-wrapper之外有div,但div logo需要保留在页面上,而loader-wrapper需要在定时事件执行所有功能之后去...
在当前形式中,加载器包装器被移除(没有发生.hide转换)以及嵌套在其中的徽标div ...有人可以建议/提供解决方法吗?
HTML看起来像这样....
<div id="loader-wrapper">
<div id ="wrapper">
<div id="logo"><a href="index.html"><img src="images/mthc/logo-main.png" height="130px" width="420px"></a>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) HTML...。
<!-- Services -->
<section id="services" class="row color" data-scroll-factor="0.7">
<div class="col-md-10 col-md-offset-1">
<div class="icon"><i class="fa fa-desktop"></i></div>
<h1>Services</h1>
<div class="section-content">
<p>Vibe Music Therapy provides music therapy interventions to a wide range of healthcare settings.<br>There are also a range or corporate CPD based training events that Vibe also get involved with.<br>Click on one of the relevent icons below to find about how we provide music therapy to the people we work with.</p>
<div class="row">
<div class="col-md-4 service">
<div class="icon service-icon animate-zoom"><i class="fa …Run Code Online (Sandbox Code Playgroud) 我有这个脚本做了一些事情,但焦点是最后一行,因为它似乎没有使类不透明度达到 100%....
$('.fa-briefcase').parent().on('click', function () {
$("#colorscreen").remove();
$( '#menu' ).multilevelpushmenu( 'collapse' );
$("body").append('<div id="colorscreen" class="animated"></div>');
$("#colorscreen").addClass("fadeInUpBig");
$('.fadeInUpBig').css('background-color', 'rgba(33,29,134, 0.2)');
$(".tile-area-main").css({width: "720px"}).load("content.html #overview");
$(".submenu-ctn").load("content.html .submenu-ctn");
$('.nav-toggle').removeClass('active');
$(this).addClass('active');
$( ".submenu-ctn" ).animate({ opacity: 10 }, 2000);
});
Run Code Online (Sandbox Code Playgroud)
该类的CSS是这样的......
.metro .submenu-ctn {
position: fixed;
left: 3px;
top: 150px;
height:400px;
width:263px;
float:left;
cursor: pointer;
overflow: hidden;
z-index : 999;
opacity:0;
}
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么 .submenu-ctn 类没有在 2 秒内动画到 100% 不透明度?
编辑 ...
由于该问题仍然导致问题,我想发布此处使用的页面的 html(根据要求)来帮助...
...来自index.html页面(东西被加载到的地方)
<!-- INITIALISE THE SPACE FOR CONTENT -->
<div class="tile-area">
<!--INITIALISE THE DIVS …Run Code Online (Sandbox Code Playgroud) 该语句将查找div #content-company并在找到时加载适当的数据.不过我的问题是:
在这种情况下,我必须使用一个滑块,我不能重命名为div,所以在这个例子中我有一个额外的名为.slides
我通常会这样做:
// JavaScript Document
$(function(){
$('.tileSB').click(function(e){
e.preventDefault();
var url = $(this).attr('href') + ' #' + $(this).attr('data-target');
$('#content-company, .slides').load(url);
});
});
Run Code Online (Sandbox Code Playgroud)
但这简单地覆盖了与div和slide类相关联的内容,因此您可以同时使用相同的名称,而我不希望这样.
谁能解释我怎么能这样做?:
// JavaScript Document
$(function(){
$('.tileSB').click(function(e){
e.preventDefault();
var url = $(this).attr('href') + ' #' + $(this).attr('data-target');
$('#content-company OR .slides').load(url);
});
});
Run Code Online (Sandbox Code Playgroud)
提前致谢