幻灯片显示下面的其他幻灯片(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
最满意答案
这个表示法
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
, notHttp
. 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 ...
-
接口使用GET方法(Interface use with GET method)[2023-05-21]
这个表示法 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#能够做到你想要达到的目的,那么语言本身就会破坏面向对象编程特性之一: 封装 。 让实现者以自己的方式实现接口,并专注于接口实现的质量,而不是将精力放在实现接口定义的方法上,而不是实现更多的方法 ( 即,实现一个单元/集成测试,实现者应该通过以验证黑盒子实际上按照您的预期工作 )。 当你使用界面时,你会得到黑匣子:你不关心实现如何完成这项工作,但是你关心它是否正确地完成工作 。 从您在自己的问题中添加的一些评论中获得: 没有具体的用例,只是希望将那些使用库的人指向面向组件的功能并避免上帝对象。 你想避 ...
-
作为接口返回的方法(Method returning as interface)[2022-03-06]
如果我正确地阅读了您的问题,您需要编译时的安全性 publicT 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 Method without an Instance)[2022-12-24]
为了科学和整个社会的教化,有没有更好的方法来做到这一点? 是。 关注点分离表明您应该使用可以实例化的其他类来从流中加载其他类,而不是将同一个类用于多个目的。 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 ...
-
接口中的静态方法(Static method in interface)[2022-06-29]
你应该有一个抽象类而不是接口,并使用deleteAll()所有类扩展该类。 You should have an abstract class instead of an interface, and make all of the classes utilizing deleteAll() extend that class.