I'm trying to add an image slider to a style and I'm getting an error when I try to add the Javasript. This is what I'm trying to do http://www.w3schools.com/w3css/tryit.as…lideshow_fading . I have added the script below to the footer template, under <!-- JAVASCRIPT_RELOCATE_POSITION -->:
<script data-relocate="true">
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 9000);
}
</script>
Display More
The error I'm getting is:
QuoteDisplay More<<<<<<<<d0da4613f81b115d66360d585dcd844063e8551d<<<<
Mon, 14 Nov 2016 00:40:25 +0000
Message: Template compilation failed: unknown tag {myIndex = 1} in template 'footer' on line 107
File: /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateScriptingCompiler.class.php (428)
PHP version: 5.6.20
WCF version: 2.1.12 (Typhoon)
Request URI: /board-list/
Referrer: https://xxxxxxxxx.net/
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Information: ""
Stacktrace:
#0 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateScriptingCompiler.class.php(243): wcf\system\template\TemplateScriptingCompiler->compileTag('myIndex = 1', 'footer', Array)
#1 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateScriptingCompiler.class.php(808): wcf\system\template\TemplateScriptingCompiler->compileString('footer', '\t\t\t\t{event name...', Array, true)
#2 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateScriptingCompiler.class.php(352): wcf\system\template\TemplateScriptingCompiler->compileIncludeTag(' file='footer'', 'boardList', Array)
#3 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateScriptingCompiler.class.php(243): wcf\system\template\TemplateScriptingCompiler->compileTag('include file='f...', 'boardList', Array)
#4 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateCompiler.class.php(30): wcf\system\template\TemplateScriptingCompiler->compileString('boardList', '{include file='...', Array)
#5 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateEngine.class.php(461): wcf\system\template\TemplateCompiler->compile('boardList', '{include file='...', '/home/xxxxxxxxx...', Array)
#6 /home/xxxxxxxxx/public_html/wcf/lib/system/template/TemplateEngine.class.php(317): wcf\system\template\TemplateEngine->compileTemplate('boardList', '/home/xxxxxxxxx...', '/home/xxxxxxxxx...', Array)
#7 /home/xxxxxxxxx/public_html/wcf/lib/page/AbstractPage.class.php(305): wcf\system\template\TemplateEngine->display('boardList', 'wbb')
#8 /home/xxxxxxxxx/public_html/wcf/lib/page/AbstractPage.class.php(100): wcf\page\AbstractPage->show()
#9 /home/xxxxxxxxx/public_html/wcf/lib/system/request/Request.class.php(58): wcf\page\AbstractPage->__run()
#10 /home/xxxxxxxxx/public_html/wcf/lib/system/request/RequestHandler.class.php(139): wcf\system\request\Request->execute()
#11 /home/xxxxxxxxx/public_html/index.php(10): wcf\system\request\RequestHandler->handle('wbb')
#12 {main}
<<<<
What can I do to get around receiving the error?