N
N
Nikolai Novosad2015-06-22 17:11:52
css
Nikolai Novosad, 2015-06-22 17:11:52

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");
        }
);

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
I
id_baton4eg, 2018-09-23
@id_baton4eg

Just make up for example on owl, slick, swiper to choose from - there is no difference.

D
dicem, 2018-09-23
@dicem

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%);
}

A
Andrey B., 2015-06-22
@nik_neman

$(".stringly").click(
        function() {
            $(".stringly").removeClass("allocation"); // Сначала удаляем предыдущее выделение
            $(this).addClass("allocation");
        }
);

S
Stalker_RED, 2015-06-22
@Stalker_RED

$(".stringly").click(
        function() {
            $(this).addClass("allocation").siblings().removeClass("allocation");
        }
);

S
Satellence, 2015-06-22
@Satellence

$(".stringly").click(
        function() {
            $(".allocation").removeClass("allocation");
            $(this).addClass("allocation");
        }
);

S
Stalker_darkway, 2015-06-22
@hronik87

$(".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 question

Ask a Question

731 491 924 answers to any question