Page 1 of 1

why an un-commented code in slideshow.tpl is still working?

Posted: Thu Sep 29, 2016 7:22 pm
by parkookk
Hi, I have opencart 2.3.0.2.
How come even through a code is uncommented in slideshow.tpl, it still working? catalog/view/theme/default/template/extension/module/slideshow.tpl

When I change the autoPlay it works.

Here is the code:

<script type="text/javascript"><!--
$('#slideshow<?php echo $module; ?>').owlCarousel({
items: 6,
autoPlay: 6000,
singleItem: true,
navigation: true,
navigationText: ['<i class="fa fa-chevron-left fa-5x"></i>', '<i class="fa fa-chevron-right fa-5x"></i>'],
pagination: true
});
--></script>

Re: why an un-commented code in slideshow.tpl is still worki

Posted: Thu Sep 29, 2016 10:41 pm
by knowband.plugins
It's not necessary any more. This has only ever served as a backwards-compatibility hack - when scripts first started being inserted into static HTML pages, most browsers couldn't support them. Without the comments, they would ignore the <script> tag (which they didn't understand), and then would emit the script source onto the page.

So basically, unless you want to support really, really old browsers (at the cost of breaking some new ones) it's no longer necessary to do this.

Re: why an un-commented code in slideshow.tpl is still worki

Posted: Fri Sep 30, 2016 8:25 pm
by parkookk
knowband.plugins wrote:It's not necessary anymore. This has only ever served as a backwards-compatibility hack - when scripts first started being inserted into static HTML pages, most browsers couldn't support them. Without the comments, they would ignore the <script> tag (which they didn't understand), and then would emit the script source onto the page.

So basically, unless you want to support really, really old browsers (at the cost of breaking some new ones) it's no longer necessary to do this.
Thank you for your reply.

So what's the best way to change the slideshow speed?

Re: why an un-commented code in slideshow.tpl is still worki

Posted: Fri Sep 30, 2016 8:53 pm
by knowband.plugins
You can change 6000 (6 seconds) to your desired time and don't make any more changes in the file.