Answer the question
In order to leave comments, you need to log in
Selecting one row of a table?
Hello.
There is a table with data that is uploaded via PHP + MySql.
How to make, that when clicking, let's say, on the 2nd line it was allocated with color. When you click on the 5th line, the selection from the 2nd second line disappears, and appears on the 5th. Etc.
This code selects all selected rows
$(".stringly").click(
function() {
$(this).addClass("allocation");
}
);
Answer the question
In order to leave comments, you need to log in
Just make up for example on owl, slick, swiper to choose from - there is no difference.
Karoch when you make up under owl, there you expose 5 images for display. On active (displayed) images, owl adds classes (.active) or something like that. This will help you do this:
.active{
transform: scale(80%);
}
.active:first-child{
transform: scale(100%);
}
$(".stringly").click(
function() {
$(".stringly").removeClass("allocation"); // Сначала удаляем предыдущее выделение
$(this).addClass("allocation");
}
);
$(".stringly").click(
function() {
$(this).addClass("allocation").siblings().removeClass("allocation");
}
);
$(".stringly").click(
function() {
$(".allocation").removeClass("allocation");
$(this).addClass("allocation");
}
);
$(".stringly").click(
function() {
$(".stringly").removeClass("allocation");
$(this).addClass("allocation");
}
);
And in general it is possible a piece of the code where this table?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question