Home > front end >  Small white for help: after the introduction of the jQuery library, jQuery TAB displays only the fir
Small white for help: after the introduction of the jQuery library, jQuery TAB displays only the fir

Time:12-06

After introducing the jQuery library, jQuery TAB displays only the first and the last one, in the middle of the military and sports don't come into effect?



Content of 11 & lt;/div>
Content of 22 & lt;/div>
Content of 33 & lt;/div>
Content of 44 & lt;/div>


JQuery (function () {
The $(document). Ready (function () {
$(". Value - col01002 - TAB li "). The mouseover (function () {
$(". Value - col01002 - TAB li "). The eq ($(this). The index ()). The addClass (" active "). The siblings (). RemoveClass (" active ");
$(" value - col01002 - cont div "). The hide (). The eq ($(this). The index ()), show ();
});
});
});
</script>

CodePudding user response:

Code no problem!

CodePudding user response:

reference 1st floor JiexC0la response:
code no problem!
solved, js is more loaded a redundant div tags, change the redundant the div to span, good magic ah, ha ha

CodePudding user response:

No problem, you send this part of the code may be CSS stylesheet problem, you send it and see the CSS code,

CodePudding user response:

Another jQuery (function () {}) and $(document). Ready (function () {}) function exactly the same, with a line, don't need a set of two layers of

CodePudding user response:

The need to use child elements selector E & gt; F
Can be ruled out the content of the div
 
JQuery (function () {
$(" value - col01002 - TAB & gt; Li "). Mouseover (function () {
$(" value - col01002 - TAB & gt; Li "). Eq ($(this). The index ()). The addClass (" active "). The siblings (). RemoveClass (" active ");
$(" value - col01002 - cont & gt; Div "). Hide (). Eq ($(this). The index ()), show ();
});
});

CodePudding user response:

reference 5 floor sky waves reply:
this to use child elements selector E & gt; F
Can be ruled out the content of the div
 
JQuery (function () {
$(" value - col01002 - TAB & gt; Li "). Mouseover (function () {
$(" value - col01002 - TAB & gt; Li "). Eq ($(this). The index ()). The addClass (" active "). The siblings (). RemoveClass (" active ");
$(" value - col01002 - cont & gt; Div "). Hide (). Eq ($(this). The index ()), show ();
});
});


Ok, thank you for the great spirit
  • Related