Jump to content

OliSig

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by OliSig

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

  2. This work fine (2 folders up and one down):

    <link rel="stylesheet" href="../../css/w3.css">

    Should this not work as well ? (1 folder up and one down)

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

  3. The structure is like this:
    
    1: ok
    http://www.abc.de/kor/home/index.html
    http://www.abc.de/kor/home/content.html
     "index.html" includes: <div w3-include-html="content.html"></div> 
    
    2: ok
    http://www.abc.de/kor/home/index.html
    http://www.abc.de/kor/home/folder/content.html
     "index.html" includes: <div w3-include-html="folder/content.html"></div> 
    
    3: not working
    http://www.abc.de/kor/home/index.html
    http://www.abc.de/kor/folder/content.html
     "index.html" includes: <div w3-include-html="../folder/content.html"></div>
    

    4: not working
    http://www.abc.de/kor/home/index.html
    http://www.abc.de/kor/content.html
     "index.html" includes: <div w3-include-html="../content.html"></div>

     

  4. Hi,

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

    works fine for me; so does:

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

    but

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

    does not i.e. picking up a code from a parallel folder.

    Please advise

    OliSig

×
×
  • Create New...