首页 \ 问答 \ 幻灯片显示下面的其他幻灯片(Slideshow shows the other slide underneath)

幻灯片显示下面的其他幻灯片(Slideshow shows the other slide underneath)

我目前有这个滑块,但是当我加载网站时,我可以看到其他幻灯片在上面。 然后加载2秒钟,然后消失,幻灯片播放开始并流畅运行。

我似乎无法弄清楚是什么原因造成的。 如果有人能帮助我,那会很棒。

这是我的JAVASCRIPT,CSS和HTML:

$("#slideshow > div:gt(0)").hide();

setInterval(function() {
  $('#slideshow > div:first')
    .fadeOut(0)
    .next()
    .fadeIn(0)
    .end()
    .appendTo('#slideshow');
},  4000);
#slideshow {
    position: relative;
    width: 100%;
    margin-top: -10px;
}

#slideshow > div {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
}

#slideshow {
  margin-top: 35px;
  background-image: url('../images/Untitled-1.jpg');
  height: 360px;
  background-size: cover;
  background-repeat: no-repeat;
}

.banner_columns {
    display: flex;
}

.img {
  margin-top: -35px;
  margin-left: 190px;
}

.column {
  flex: 1;
}

.column-one {
    order: 1;
}

.column-two {
    order: 2;
    margin-top: 100px;
    margin-left: -100px;
}

.header1 {
  color: #1e1e1c;
  font-size: 19px;
  line-height: 24px;
  font-weight: 700;
  font-style: italic;
}

.p {
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 300;
}

.button1 {
  color: #fff;
  font-size: 15px;
  margin-left: 8px;
  padding: 3px 30px;
  background-color: #b52323;
  font-weight: 700;
  text-decoration: none;
}

.button_1 {
  color: #fff;
  font-size: 15px;
  padding: 3px 30px;
  background-color: #b52323;
  font-weight: 700;
  text-decoration: none;
}

.button2 {
  font-size: 15px;
  font-weight: 300;
  color: #fff;
  padding: 3px 22px;
  background-color: #656565;
  text-decoration: none;
}
<div id="slideshow">
<div class="bgbanner">
  <div class="banner_columns1">
    <div class="column column-one">
      <div class="banner">
        <img class="img" src="images/Bog-til-hjemmeside2.png" width="380">
      </div>
    </div>
    <div class="column column-two">
      <h1 class="header1">“Velfungerende roman, der effektivt skifter <br>mellem krigstraumer, flugt og bekymringer. <br>En hæderlig bog om den værste krig i EU.”</h1>
      <p class="p">- Kristeligt Dagblad, 2013</p>
      <a class="button_1" href="https://www.saxo.com/dk/knacker_karsten-skov_haeftet_9788792975102">Køb nu</a>
    </div>
  </div>
</div>
<div class="bgbanner">
  <div class="banner_columns1">
    <div class="column column-one">
      <div class="banner">
        <img class="img" src="images/Bog-til-hjemmeside.png" width="380">
      </div>
    </div>
    <div class="column column-two">
      <h1 class="header1">“Velfungerende roman, der effektivt skifter <br>mellem krigstraumer, flugt og bekymringer. <br>En hæderlig bog om den værste krig i EU.”</h1>
      <p class="p">- Kristeligt Dagblad, 2013</p>
      <a class="button2" href="bibliografi_knacker.html">Læs mere...</a>
      <a class="button1" href="https://www.saxo.com/dk/knacker_karsten-skov_haeftet_9788792975102">Køb nu</a>
    </div>
  </div>
</div>
</div>

提前致谢!


I currently have this slider, but when i load the website, I can see the other slide on top. Then for 2 secs it loads, and then it disappears and the slideshow starts and works fluently.

I can't seem to figure out what is causing it. Would be great if someone could help me out.

Here is my JAVASCRIPT, CSS & HTML:

$("#slideshow > div:gt(0)").hide();

setInterval(function() {
  $('#slideshow > div:first')
    .fadeOut(0)
    .next()
    .fadeIn(0)
    .end()
    .appendTo('#slideshow');
},  4000);
#slideshow {
    position: relative;
    width: 100%;
    margin-top: -10px;
}

#slideshow > div {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
}

#slideshow {
  margin-top: 35px;
  background-image: url('../images/Untitled-1.jpg');
  height: 360px;
  background-size: cover;
  background-repeat: no-repeat;
}

.banner_columns {
    display: flex;
}

.img {
  margin-top: -35px;
  margin-left: 190px;
}

.column {
  flex: 1;
}

.column-one {
    order: 1;
}

.column-two {
    order: 2;
    margin-top: 100px;
    margin-left: -100px;
}

.header1 {
  color: #1e1e1c;
  font-size: 19px;
  line-height: 24px;
  font-weight: 700;
  font-style: italic;
}

.p {
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 300;
}

.button1 {
  color: #fff;
  font-size: 15px;
  margin-left: 8px;
  padding: 3px 30px;
  background-color: #b52323;
  font-weight: 700;
  text-decoration: none;
}

.button_1 {
  color: #fff;
  font-size: 15px;
  padding: 3px 30px;
  background-color: #b52323;
  font-weight: 700;
  text-decoration: none;
}

.button2 {
  font-size: 15px;
  font-weight: 300;
  color: #fff;
  padding: 3px 22px;
  background-color: #656565;
  text-decoration: none;
}
<div id="slideshow">
<div class="bgbanner">
  <div class="banner_columns1">
    <div class="column column-one">
      <div class="banner">
        <img class="img" src="images/Bog-til-hjemmeside2.png" width="380">
      </div>
    </div>
    <div class="column column-two">
      <h1 class="header1">“Velfungerende roman, der effektivt skifter <br>mellem krigstraumer, flugt og bekymringer. <br>En hæderlig bog om den værste krig i EU.”</h1>
      <p class="p">- Kristeligt Dagblad, 2013</p>
      <a class="button_1" href="https://www.saxo.com/dk/knacker_karsten-skov_haeftet_9788792975102">Køb nu</a>
    </div>
  </div>
</div>
<div class="bgbanner">
  <div class="banner_columns1">
    <div class="column column-one">
      <div class="banner">
        <img class="img" src="images/Bog-til-hjemmeside.png" width="380">
      </div>
    </div>
    <div class="column column-two">
      <h1 class="header1">“Velfungerende roman, der effektivt skifter <br>mellem krigstraumer, flugt og bekymringer. <br>En hæderlig bog om den værste krig i EU.”</h1>
      <p class="p">- Kristeligt Dagblad, 2013</p>
      <a class="button2" href="bibliografi_knacker.html">Læs mere...</a>
      <a class="button1" href="https://www.saxo.com/dk/knacker_karsten-skov_haeftet_9788792975102">Køb nu</a>
    </div>
  </div>
</div>
</div>

Thanks in advance!


原文:https://stackoverflow.com/questions/41143047
更新时间:2022-04-16 14:04

最满意答案

这个表示法

this.http.get<UserResponse>(this.baseUrl).subscribe((data) => {
  console.log(data.research);
});

是用于HttpClient ,而不是Http 。 你应该保留这种表示法并使用HttpClient,因为Http很快就会被弃用。


this notation

this.http.get<UserResponse>(this.baseUrl).subscribe((data) => {
  console.log(data.research);
});

Is the one used with HttpClient, not Http. You should keep this notation and use HttpClient, because Http will be deprecated soon.

相关问答

更多
  • Ctrl + Shift + R可以访问重构菜单,然后选择Pull Members Up ... 您可以选择要添加声明的接口,并选择要添加到接口的每个方法。 得到爱Resharper! ;-) Ctrl+Shift+R to access the refactoring menu then choose Pull Members Up... You can choose the interface that you want to add the declarations to and also selec ...
  • 这个表示法 this.http.get(this.baseUrl).subscribe((data) => { console.log(data.research); }); 是用于HttpClient ,而不是Http 。 你应该保留这种表示法并使用HttpClient,因为Http很快就会被弃用。 this notation this.http.get(this.baseUrl).subscribe((data) => { console ...
  • 如果C#能够做到你想要达到的目的,那么语言本身就会破坏面向对象编程特性之一: 封装 。 让实现者以自己的方式实现接口,并专注于接口实现的质量,而不是将精力放在实现接口定义的方法上,而不是实现更多的方法 ( 即,实现一个单元/集成测试,实现者应该通过以验证黑盒子实际上按照您的预期工作 )。 当你使用界面时,你会得到黑匣子:你不关心实现如何完成这项工作,但是你关心它是否正确地完成工作 。 从您在自己的问题中添加的一些评论中获得: 没有具体的用例,只是希望将那些使用库的人指向面向组件的功能并避免上帝对象。 你想避 ...
  • 如果我正确地阅读了您的问题,您需要编译时的安全性 public T getType (MyEnum enum) 为MyEnum.A返回A ,为MyEnum.B等返回B 如果使MyEnum类具有通用性,则可以实现此编译时安全性。 这现在适用于普通的枚举,但它适用于老式的“类型安全枚举”模式。 假设我们有三个接口AA , BB , CC扩展基接口II : public interface AA extends II { void a(); } public interface ...
  • 如果要创建可调用且具有其他功能的对象,最好的方法是从function对象开始。 但是,由于函数的本机推断类型与您构建的实际类型不匹配,因此需要一个类型断言: interface Fn { (): A } function buildFn( val: A ): Fn { return () => { return val } } export interface FnString extends Fn { (): string toLowe ...
  • 为了科学和整个社会的教化,有没有更好的方法来做到这一点? 是。 关注点分离表明您应该使用可以实例化的其他类来从流中加载其他类,而不是将同一个类用于多个目的。 interface ISaveObjects { Stream Save(T obj); } interface ILoadObjects { T Load(Stream stream); } public class MyClassStreamer : ISaveObjects, ILoadObjec ...
  • 您不能使用界面中的方法。 接口没有代码,只有定义。 可以将其视为实现它的类必须实现的功能契约 。 例如 public interface Example { public void method1ToImplement(); public int method2ToImplement(final String input); } 这是一个实现此接口的所有类必须满足的合同。 这意味着任何implements Example实例化类都必须实现public void method1ToImple ...
  • 如果允许在填充过程中传递List而不是启动自己的List ,则对调用者更有效。 它还可以使代码易于单元测试,因为这样做的模式称为依赖注入。 public List populateWithAvailableLanguages(List list) { Iterator> it = this.iterator(); // List list = new ArrayList(); ...
  • 从Java 8开始,您可以将方法实现放入接口中。 http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html interface A { default void aMethod() { // method body } } 在早期版本中,您必须使A成为一个类而不是一个接口。 一个抽象类,如果更适合你的模型。 abstract class A { public void aMethod ...
  • 你应该有一个抽象类而不是接口,并使用deleteAll()所有类扩展该类。 You should have an abstract class instead of an interface, and make all of the classes utilizing deleteAll() extend that class.

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)