• Hi all,

    Am using the Pursuit theme and all works fine.
    Only one javascript error that bugs me: the only info I got is that the bugs’s in main.js on line 625 and it’s an empty string for getElementById.
    Now I’ve looked at that specific line and this is what it says:

    if ( document.getElementById(tgt) ) {

    The whole scriplet is:

    .ready(function() {
          jQuery(window).bind('hashchange', function(event) {
            var tgt = location.hash.replace(/^#\/?/,'');
    
    		if ( document.getElementById(tgt) ) {
    
    			// There are a few offsets that need to be calculated
    			var smoothScroll_offset = 0;
    			var navbar_collapse_offset = 0;
    			if (jQuery("header").hasClass("headhesive--clone")) {
    				smoothScroll_offset = jQuery(".headhesive--clone").height() ;
    				if(jQuery("header nav.navbar-collapse").hasClass("in")){
    					navbar_collapse_offset = jQuery("header nav.navbar-collapse.in").height() ;
    					smoothScroll_offset =  smoothScroll_offset - navbar_collapse_offset;
    				}
    			}
    
    			jQuery.smoothScroll({offset: -smoothScroll_offset, scrollTarget: '#' + tgt,
    				beforeScroll: function() { // Close Mobile Menu
    					var bsNav = jQuery('header .navbar-collapse');
    
    					if (bsNav.hasClass("collapse in")) {
    						bsNav.removeClass("in");
    						//mainNav.removeClass("open");
    					}
    				},
    				afterScroll: function() {  // Update Active Links, but not for mobile / touch
    					if(!isTouch){
    					var links = jQuery('nav ul.navbar-nav').find('li.th-anchor a');
    
    						jQuery(links).each(function() {
    							var hashtag = jQuery(this).attr('href').split('#')[1];
    							if(hashtag === tgt){
    								jQuery(this).parent('li').addClass('active');
    							}else{
    								jQuery(this).parent('li').removeClass('active');
    							}
    						});
    					}
    				}
    
    			});
            }
          });
          jQuery(window).trigger('hashchange');

    Any thoughts?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Theme Pursuit] javascript error’ is closed to new replies.