Iron: Router changing styling

Hello there, so I am using iron:router

When just run my code without the router :


    {{> navbar }} {{> ccinfo}}

it shows one way, but then when I run it through the router a part of it runs differently, especially the slider. This is my code pertaining to the slider

 $(function () {
     var $r = $('input[type="range"]');
     var $ruler = $('<div class="rangeslider__ruler" />');

     // Initialize
         polyfill: false,
         onInit: function () {
             $ruler[0].innerHTML = getRulerRange(this.min, this.max, this.step);

     function getRulerRange(min, max, step) {
         var range = '';
         var i = 0;

         while (i <= max) {
             range += i + ' ';
             i = i + step;
         return range;
     var $document = $(document);
     var selector = '[data-rangeslider]';
     var $inputRange = $(selector); /** * Example functionality to demonstrate a value feedback * and change the output's value. */

     $document.on('click', '#js-example-change-value button', function (e) {
         var $inputRange = $('[data-rangeslider]',;
         var value = $('input[type="number"]',[0].value;
     }); /** * Example functionality to demonstrate programmatic attribute changes */
     $document.on('click', '#js-example-change-attributes button', function (e) {
         var $inputRange = $('[data-rangeslider]',;
         var attributes = {
             min: $('input[name="min"]',[0].value,
             max: $('input[name="max"]',[0].value,
             step: $('input[name="step"]',[0].value
         $inputRange.attr(attributes).rangeslider('update', true);
     }); /** * Example functionality to demonstrate destroy functionality */
     $document.on('click', '#js-example-destroy button[data-behaviour="destroy"]', function (e) {
     }).on('click', '#js-example-destroy button[data-behaviour="initialize"]', function (e) {
             polyfill: false

Is there any reason in that slider code that it would run differently through the router when I just reference the template?

I want to keep on using this as the slider looks great

I am using aramk:rangeslider

Thank you

Would love some help with this, I can provide any additional information if required!

Thank you!

If no one has experience with this slider, can anyone reccomend me a way to put ruler marks and a better looking slider for input type=range?