How to nominate only one element in jquery?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
51 views
There is a reduction of the text is its full form, the problem in that, when you click on an abbreviation to full forward. Such units with reduced and full text of several.
But when you click on reduction, put forward the full text.
$('.AboutName').click(function() { var pos = $('.AboutName').next(); $(pos).fadeToggle(); })

The reduction...Dipole, testttttttttttttttttttttttttttThe reduction...Dipole, testttttttttttttttttttttttttttThe reduction...Dipole, testtttttttttttttttttttttttttt
by | 51 views

2 Answers

0 like 0 dislike
var pos = $(this).next();

this transmits itself to the DOM element on which the click occurred.
In General, I advise you to learn more about the context and this, otherwise, further development in JS is a hell of a misunderstanding.
Directly to youtube or dial this context - there are some steep rollers in Russian on these topics, but will have them a few times to watch to understand what is what)

And JQuery is put on the shelf, it gets old and some already think it is the bad form.
by
0 like 0 dislike
Instead of $('.AboutName').next(); Write $(this).next(); And everything will be okay
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
asked Jun 11, 2019 by IT-Programmer
0 like 0 dislike
2 answers
110,608 questions
257,187 answers
0 comments
40,796 users