Deutsch

как работает оnClick

13.10.17 09:11
Re: как работает оnClick
 
NightWatch коренной житель
NightWatch
в ответ Валидол 11.10.17 22:17, Последний раз изменено 13.10.17 09:24 (NightWatch)

Работает простым переключением свойства display с block на none и наоборот.

.nmb-gal {
    display: none;
}
.nmb-gals-target span[id^='gal']:target ~ :nth-of-type(1).nmb-gal {
    display: none !important;
}
.nmb-gals-target span[id='gal1']:target ~ :nth-of-type(1).nmb-gal {
    display: block !important;
}
.nmb-gals-target span[id^='gal']:not(:target) ~ :nth-of-type(1).nmb-gal, .nmb-gals-target span:nth-of-type(1):target ~ :nth-of-type(1).nmb-gal,
.nmb-gals-target span:nth-of-type(2):target ~ :nth-of-type(2).nmb-gal, .nmb-gals-target span:nth-of-type(3):target ~ :nth-of-type(3).nmb-gal,
.nmb-gals-target span:nth-of-type(4):target ~ :nth-of-type(4).nmb-gal, .nmb-gals-target span:nth-of-type(5):target ~ :nth-of-type(5).nmb-gal,
.nmb-gals-target span:nth-of-type(6):target ~ :nth-of-type(6).nmb-gal, .nmb-gals-target span:nth-of-type(7):target ~ :nth-of-type(7).nmb-gal,
.nmb-gals-target span:nth-of-type(8):target ~ :nth-of-type(8).nmb-gal, .nmb-gals-target span:nth-of-type(9):target ~ :nth-of-type(9).nmb-gal,
.nmb-gals-target span:nth-of-type(10):target ~ :nth-of-type(10).nmb-gal, .nmb-gals-target span:nth-of-type(11):target ~ :nth-of-type(11).nmb-gal,
.nmb-gals-target span:nth-of-type(12):target ~ :nth-of-type(12).nmb-gal {
    display: block;
}
 

Перейти на