• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC tell me what is wrong this code js?

norrow

Member
Joined
Dec 16, 2012
Messages
129
Reaction score
7
Location
Poland
Hello, could someone please tell me what is wrong with this code? I remember that some time ago it was working normally and now nothing is showing
layout.php gesior acc
PHP:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="tibiacom/adv/fadeslideshow.js"></script>
<script type="text/javascript">
var mygallery=new fadeSlideShow({
    wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    dimensions: [204, 131], //width/height of gallery in pixels. Should reflect dimensions of largest image
    imagearray: [
        ["layouts/tibiacom/adv/images/4.png", "/index.php?subtopic=latestnews", "", "txt"],
        ],
    displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false},
    persist: false, //remember last viewed slide and recall within same session?
    fadeduration: 500, //transition duration (milliseconds)
    descreveal: "peekaboo",
    togglerid: ""
})
</script>

<script type="text/javascript" src="tibiacom/javascripts/fadeslideshow.js"></script>
<div id="fadeshow1"></div>
<div id="fadeshow1"></div>
 
Well....without seeing the full code, I can see a few things that are wrong here.
1. You need to update to jQuery 3.6.0, the latest stable build.
2. You also have two divs with the id "fadeshow1", you only need one.
3. The array named "imagearray" which I presume should only contain images or imagedata, has random things in it such as a page link and a random string "txt".
4. You have two instances of fadeslideshow.js located in two different folders. One on line 2 and one on line 18 of the example code you've posted.
 
Are there any errors in the console? As I said before, it's hard to diagnose without more context.

The image array may just need to be a single dimension array
Try this instead:
JavaScript:
imagearray: ["layouts/tibiacom/adv/images/4.png"],

Add me on discord, it's in my signature
 
Could try a couple more things.

1. Move the div's above the scripts
2. Wrap the javascript code inside a document.ready like this.
JavaScript:
$(document).ready(function(){
    var mygallery=new fadeSlideShow({
        wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
        dimensions: [204, 131], //width/height of gallery in pixels. Should reflect dimensions of largest image
        imagearray: [
            ["layouts/tibiacom/adv/images/4.png", "/index.php?subtopic=latestnews", "", "txt"],
            ],
        displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 500, //transition duration (milliseconds)
        descreveal: "peekaboo",
        togglerid: ""
    })
})

It could be an issue with the fadeSlideShow plugin itself.
 
Back
Top