I'm facing an issue while trying to implement the perfect-scrollbar plugin on my AngularJS website. The error I encounter is as follows:
TypeError: element.getAttribute is not a function at getId (http://localhost/Myproject/js/lib/perfect-scrollbar.jquery.js:1299:20) at Object.exports.get (http://localhost/Myproject/js/lib/perfect-scrollbar.jquery.js:1334:20)
Here's what I have tried:
// connections
link href="css/perfect-scrollbar.min.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="js/lib/perfect-scrollbar.jquery.js"></script>
<script src="js/lib/perfect-scrollbar.js"></script>
//styles
.carousel-in-circles {
position: relative;
overflow: hidden;
width: 100%; /* I need horizontal scrollbar only */
}
// directive use
<div class="carousel-in-circles" perfect-scrollbar>...</div>
// angularJS directive
angular.module('myproject.directives').
directive('perfectScrollbar', function () {
return {
link: function (el) {
$(document).ready(function (){
$(el).perfectScrollbar();
});
}
};
});
I seem to be stuck with this issue and would greatly appreciate any advice...