Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 14 Pomógł: 0 Dołączył: 2.02.2022 Ostrzeżenie: (0%)
|
Witam serdecznie,
Mam na stronie treści pobierane z bazy danych. Załóżmy że mam zmienną $txt ze stringiem. Zdarzają się w nich nich obrazki w różnych postaciach: - <img alt="XXXX" class="img-fluid" src="random.name" style="height:930px; width:620px" /> - <img alt="XXXX" class="img-fluid" src="random.name"/> - <img src="random.name"/> etc Potrzebuję dodać do każdego obrazka: class "picla" and data-label-class="label-class" - czyli w rezultacie: - <img alt="XXXX" class="img-fluid picla" src="random.name" style="height:930px; width:620px" data-label-class="label-class"/> - <img alt="XXXX" class="img-fluid picla" src="random.name" data-label-class="label-class"/> - <img class="picla" src="random.name" data-label-class="label-class"/> Wie ktoś może jak to zrobić?(IMG:style_emoticons/default/smile.gif) |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 6 809 Pomógł: 1828 Dołączył: 11.03.2014 Ostrzeżenie: (0%)
|
Zanim uruchomisz ten plugin, dodaj po prostu brakujące wartości i atrybuty w JS.
https://api.jquery.com/addclass/ https://api.jquery.com/attr/ |
|
|
|
baracuda [PHP]Wyszukiwanie obrazka i modyfikowanie stringi 9.05.2022, 20:57:39
phpuser88 [PHP] pobierz, plaintext $txt = str_replace('i... 9.05.2022, 21:18:47
baracuda Cytat(phpuser88 @ 9.05.2022, 22:18:47... 9.05.2022, 21:38:41
phpuser88 Najlepiej byłoby odpytać SQL gdzie znajdują się wa... 9.05.2022, 21:44:11
trueblue Cytat(baracuda @ 9.05.2022, 22:38:41 ... 10.05.2022, 07:20:54
Salvation Cytat(trueblue @ 10.05.2022, 08:20:54... 10.05.2022, 07:48:39 
trueblue Cytat(Salvation @ 10.05.2022, 08:48:3... 10.05.2022, 08:13:31
baracuda Cytat(trueblue @ 10.05.2022, 09:13:31... 10.05.2022, 09:38:53
trueblue Z tego co widzę, to podpisy pobierane są z atrybut... 10.05.2022, 09:48:13
baracuda Zdjęcie ma taki atrybut:
[HTML] pobierz, plaintext... 10.05.2022, 09:53:05
trueblue W odpowiedniej kolejności uruchamiasz skrypty, tj.... 10.05.2022, 10:14:42
baracuda Problem rozwiązany Miałem złą kolejność 10.05.2022, 10:40:27 ![]() ![]() |
|
Aktualny czas: 1.01.2026 - 23:38 |