Jump to content

Help with SLIDESHOW - W3CSS


gordonisnz

Recommended Posts

https://www.w3schools.com/w3css/w3css_slideshow.asp

 

Hello. Im following the examples in the above slideshow. However Ive got a slight problem. 

  <div class="mySlides w3-container"><a href="/todo#feedback" class="w3-bar-item w3-button w3-mobile">Feedback</a></div>
<div class="mySlides w3-container"><a href="/todo#feedback" class="w3-bar-item w3-button w3-mobile">Contact us</a></div>
  <div class="mySlides w3-container"><a href="/todo#feedback" class="w3-bar-item w3-button w3-mobile">Feedback</a></div>
 

I had only 2 lines,  however Nothing worked - it didnt do anything.  so i added the BODY ONLOAD command - (not shown in your example).

 

next problem, is that it showed "feedback" VERY QUICKLY, and then "Contact us" for several seconds. Then it BRIEFLY (in a flash) showed FEEDBACK - and then Contact us for a few seconds.

So i copied the FEEDBACK line in again.  But stil same problem - it VERY BRIEFLY shows a lime, & then several seconds of the next phrase.

Can anyone assist with this problem ? 

 

Problem website:  http://foe.kwister.com

 

 

 

 

 

Link to comment
Share on other sites

In effect you are running setTimeout() twice! these are conflicting, first timer shows feedback 2sec, then next timer does the same over-riding the first so it may last on some occasions up to 4sec instead of 2sec. You don't require body onload, from what have seen it works perfectly fine without it.

You have two 'feedback' text, compared to single  'contact us', as it reaches last 'feedback' and loops back to first 'feedback' you have 2 + 2 secs of 'feedback' compared to 2sec each time for 'contact us'

Edited by dsonesuk
Link to comment
Share on other sites

i did the 2 x feedback limes to compensate for the fact the 1st one didnt show up enough.

- Removed the onload command.  But its still loading the settimeout twice..  However i cant see how.

 

Can you advise where i should move the timeout command so it only runs one time. I'll fix it when i return home   

Link to comment
Share on other sites

It works

https://www.w3schools.com/code/tryit.asp?filename=FVC4MG2Z44GK

it changes every 2 seconds, from 'feedback' to 'contact us', then back (note i removed last 'feedback' html). That's what that does! IF you are expecting something different? tell us what you expected.

If you wish them to stay visible a bit longer change 2000 (every 1000 = 1sec) to a higher value.

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...