Skip to main content
added 26 characters in body
Source Link
user34073
user34073

I've noted some details, let me explain:


  1. 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'


  1. 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"

  1. 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!

I've noted some details, let me explain:


  1. CSS Selectors. jQuery allows you to use them too:

    $("[id^='content-wrap']") --> will select all elements which id starts with 'content-wrap'


  1. Substring is an available method of JavaScript:

    var number = "navItem15".substring(7); // will return what is after position 7.. // resulting the number "15"


  1. 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!

I've noted some details, let me explain:


  1. CSS Selectors. jQuery allows you to use them too:

    $("[id^='content-wrap']") --> will select all elements which id starts with 'content-wrap'


  1. Substring is an available method of JavaScript:
var number = "navItem15".substring(7);
// will return what is after position 7.. 
// resulting the number "15"

  1. 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!

Source Link
removed
  • 111
  • 4

I've noted some details, let me explain:


  1. CSS Selectors. jQuery allows you to use them too:

    $("[id^='content-wrap']") --> will select all elements which id starts with 'content-wrap'


  1. Substring is an available method of JavaScript:

    var number = "navItem15".substring(7); // will return what is after position 7.. // resulting the number "15"


  1. 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!