JScript fails after Cornerstone update

Hey there,

I have a custom script that turns my navigation transparent on the header video and solid white on the rest of the page. When I update Cornerstone from Version 3.0.4 to 3.1.5 the script fails though and stays transperant.
Is there any fix for this or should I not update Cornerstone? My script attached below

 jQuery(document).ready(function($){
  // Detect if this is a hero image page by looking for the #heroimage ID
  if( $('#heroimage').length ){
    // get the value of the bottom of the #heroimage element by adding the offset of that element plus its height, set it as a variable
    var mainbottom = $('#heroimage').offset().top + $('#heroimage').outerHeight(true);

    $(window).on('scroll',function(){
      var stop = Math.round($(window).scrollTop());
      // If the use has scrolled past the bottom of the hero image
      if (stop > mainbottom) {
          $('.x-navbar').addClass('pasthero');
      } else {
      // if the user has scrolled back up above the bottom of the hero image
          $('.x-navbar').removeClass('pasthero');
      }
    });
  } else {
  // if no hero image present, add the opaque class right away
     $('.x-navbar').addClass('pasthero');
  }
});

Hello @KITCHENTOWN,

Thanks for asking. :slight_smile:

It’s always advisable and recommended to use latest version of X Theme and Cornerstone. It ensures that you are getting new features that comes with updates, bug fixes etc etc.

However, it’s difficult for us to provide support for custom scripts as it fall outside the scope of support we can offer. I suggest you to get in touch with a developer for some professional help.

Thanks for understanding.

Hey,

I’m not asking you to fix my script though. That has been working all along.
It’s the latest update of Cornerstone that suddenly blocks all js in the global js section.
That should fall under your support should it not?

Cheers

Hi There @KITCHENTOWN

I have checked the site URL assigned to your license and I see that you’re using X 6.0.4 and Cornerstone 3.0.4 there. If you can setup a staging site with the latest version, we can check your issue there, though we cannot guarantee a solution.

If you’re interested in setting up a staging site, please refer to the following guide here.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.