0

I am new to Drupal. I have converted Psd to html template after html to drupal theme. After converting all css files are working but javascript files are not working properly. For example javasccript code for navbar fix on top is like this

(window).scroll(function(){
  var sticky = $('.menubar'),
      scroll = $(window).scrollTop();

  if (scroll >= 586) sticky.addClass('fixed');
  else sticky.removeClass('fixed');
});

this code is working on normal template but not in drupal theme.Here is the libraries.ylm file

lobal-css:
  css:
    theme:
      css/bootstrap.css: {}
      css/font-awesome.css: {}
      css/responsive-menu.min.css: {}
      css/style.css: {}
      
global-js:
  js:
    js/bootstrap.js: {}
    js/jquery.singlePageNav.min.js: {} 
    js/responsive-menu.js: {} 
    js/customscript.js: {}    
  dependencies:
      - core/jquery 

customscript.js is having all custom javascript code. Please help me.

2
  • Please, post your theme.info.yml Commented Oct 28, 2016 at 21:17
  • u need to attach somehow your library, check this out stackoverflow.com/questions/26512831/… Commented Nov 2, 2016 at 17:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.