سؤال

I am neewbie in Phpfox script and I started with creating a new template.During that I encountered the following problem with nicescroll jQuery. When I try to implement it outside the Phpfox it works. But when I try into Phpfox then it messes up and don't work. I tried to exclude other js and leave just the ones that are needed for this to work and it wasn't helpfull. Here is the concrete example of what is going on:

<script>
$(document).ready(
function() {
$('html').niceScroll();
}
);

</script>

And when i check on inspect element or page source it shows like this:

<script>

$(document).ready(
function() htmlniceScroll);


</script>

Thanks in advance for the answer.

هل كانت مفيدة؟

المحلول

Use {literal} before using any { or } and use {/literal} after using { or } because text between { and } in template are spoused to be default keywords defined in phpfox libraries.

For Example you will type your current code as below :

{literal}
<script>
$(document).ready(
function() {
$('html').niceScroll();
}
);
</script>
{/literal}

And you can also try {r} for { and {l} for }

Like as below :

<script>
$(document).ready(
function() {r}
$('html').niceScroll();
{l}
);
</script>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top