It’s my understanding that custom JavaScript should be included in assets/scripts/main.js
So I added this line to the file below line 21: $( ".menu ul li" ).attr( "class", "col" );
But it’s not working.
Can anyone help me understand what I’m missing?
Thank you.
gistfile1.txt
/* ========================================================================
* DOM-based Routing
* Based on http://goo.gl/EUTi53 by Paul Irish
*
* Only fires on body classes that match. If a body class contains a dash,
* replace the dash with an underscore when adding it to the object below.
*
* .noConflict()
* The routing is enclosed within an anonymous function so that you can
* always reference jQuery with $, even when in .noConflict() mode.
This file has been truncated. show original
Custom javascript should be added to the relevant route more than the main.js
. Your main.js
is your router, it’s purpose is to call the appropriate javascript depending on which page you’re viewing.
I’d say it’s not working cause your file is wrong (you’re not passing your routes object to the router). Check the source here:
https://github.com/roots/sage/blob/master/assets/scripts/main.js
ben
March 20, 2017, 1:48pm
3
@Nicolo_Sacchi he’s using Sage 8, not Sage 9 (which is the main JS you linked)
@s3w47m88 Did you compile your scripts / run gulp
?
@ben yes, I’m running gulp watch
.
My mistake, pardon, I misread the gist