I've noted some details, let me explain:
CSS Selectors. jQuery allows you to use them too:
$("[id^='content-wrap']")
$("[id^='content-wrap']")
--> will select all elements which id starts with 'content-wrap'
Substring is an available method of JavaScript:
var number = "navItem15".substring(7); // will return what is after position 7.. // resulting the number "15"
Substring is an available method of JavaScript:
var number = "navItem15".substring(7);
// will return what is after position 7..
// resulting the number "15"
To start your menu with the first position. This is the best way:
(function(){ $("#navItem1").trigger("click"); })(); // using this approach, you won't need copy your code into a function as you did // this approach triggers the "click" event in the first menu automatically
To start your menu with the first position. This is the best way:
(function(){
$("#navItem1").trigger("click");
})();
// using this approach, you won't need copy your code into a function as you did
// this approach triggers the "click" event in the first menu automatically
Well, hope you got it!
Nice coding!