By Bärbel Brantner on Monday, 10 April 2017
Posted in Technical Issues
Likes 0
Views 605
Votes 0
With my template occurs this error on this menu:
https://sandkiste.flute.at/werkstatt.html (as well as on subpages)

Uncaught TypeError: $.scrollTo is not a function
at originalScrollTo (common.js:9)
at a.fn.init.$.fn.scroll (common.js:25)
at HTMLDocument.<anonymous> (werkstatt.html:878)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.K (jquery.min.js:2)
originalScrollTo @ common.js:9
$.fn.scroll @ common.js:25
(anonymous) @ werkstatt.html:878
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
K @ jquery.min.js:2


I've added this script to the bottom of my index.php:


<script type="text/javascript">
// http://html-tuts.com/back-to-top-button-jquery/
// create the back to top button
jQuery(document).ready(function(){

jQuery('body').prepend('<a href="#" class="back-to-top btn no-btn btn-sm hidden-sm hidden-xs"><i class="fa fa-arrow-circle-up" aria-hidden="true"></i>Back to Top</a>');

var amountScrolled = 200;

jQuery(window).scroll(function() {
if ( jQuery(window).scrollTop() > amountScrolled ) {
jQuery('a.back-to-top').fadeIn('slow');
} else {
jQuery('a.back-to-top').fadeOut('slow');
}
});

jQuery('a.back-to-top, a.simple-back-to-top').click(function() {
jQuery('html, body').animate({
scrollTop: 0
}, 700);
return false;
});
});
</script>


The error only occurs in Google Chrome.

Can you give me some help to solve this issue? Thank you!
I believe you are attaching a custom scrollto library on the page and there is a naming conflict. If you want to render your own version of scrollto, you will need to configure Komento load it's own version of jQuery to avoid conflicts like this.

You can enable this under Settings > System
·
Tuesday, 11 April 2017 11:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, not entirely sure how is this related to Komento?
·
Monday, 10 April 2017 22:31
·
0 Likes
·
0 Votes
·
0 Comments
·
There is a conflict with row 9 in /media/com_komento/scripts/common.js.


var originalScrollTo = function (element) {
$.scrollTo(element, 500);
};
·
Monday, 10 April 2017 23:39
·
0 Likes
·
0 Votes
·
0 Comments
·
The error only appears on pages where Komento is included
·
Monday, 10 April 2017 23:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Great, that solved the problem!
·
Tuesday, 11 April 2017 16:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Tuesday, 11 April 2017 17:11
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post