Jump to content

I have a problem combining "w3-include" and "w3-slideshow"


OliSig

Recommended Posts

Hi, I need some help

I am trying to combine "w3-include" and "w3-slideshow".
My code is as follows but it does not work.
I guess "id01" is missing in the external file, but where do I place it in there ?

Regards
Olafur


************* External file (content.html): **************
<img class="nature" src="img_snowtops.jpg" width="50%">
<img class="nature" src="img_mountains.jpg" width="50%">
<img class="nature" src="img_nature.jpg" width="50%">
<p>
<button onclick="myShow.previous()">Previous</button>
<button onclick="myShow.next()">Next</button>
</p>
**********************************************************

************* Main file **********************************
<!DOCTYPE html>
<html>
<title></title>
<script src="https://www.w3schools.com/lib/w3.js"></script>

<body>
<div w3-include-html="content.html"></div>

<script>
myShow = w3.slideshow(".nature", 0);
</script>

<script>
w3.includeHTML(myCallback);
function myCallback() { w3.displayObject("id01", myShow ); }
</script>

</body>
</html>

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...