Похожие чаты

Hi guys, how do we programmatically change css from ajax?

it is required due to pseudo thingy

26 ответов

20 просмотров

I read this from right to left and left to right still doesn't make any sense, kindly share before and after pictures

You have two questions here: * How do I use the result of AJAX calls? * How do I change CSS with JS? The answer to the second is "You can't". What you can do is add or remove <style> tags, modify .style props of elements, and change classes of elements

akh Amirul-Idzham Автор вопроса
Richard | Dm for Paid Support
I read this from right to left and left to right s...

I don't have my resources now but what I can tell you that I need to set top position of sticky display row of table header according to its content. It's dynamic row

akh Amirul-Idzham Автор вопроса
Simen
You have two questions here: * How do I use the re...

I see... The ajax call return strings array to be output as row header that required sticky row position from top. Well as per you said, I guess as per my reading on web, there's no way for inline styling for pseudo elements. Guess I've to find another way

akh Amirul Idzham
I don't have my resources now but what I can tell ...

let me get this straight, you fetch html from a remote server and you want to apply styling to the first row (make it sticky)?

akh Amirul-Idzham Автор вопроса
Richard | Dm for Paid Support
let me get this straight, you fetch html from a re...

Sorry but nope, I get data only from ajax to append those rows. I just need to do some calculations to set the top of sticky position

akh Amirul Idzham
I see... The ajax call return strings array to be ...

True, there is no way to directly style pseudo elements with js, but you can use css variables. Set the variable value with javascript, and use the value in the css

devFojo Olubo
True, there is no way to directly style pseudo ele...

PS: This is me assuming you're using React or it's frameworks. I don't know how to achieve this in vanilla JS or other JS frameworks

akh Amirul-Idzham Автор вопроса
akh Amirul-Idzham Автор вопроса
akh Amirul Idzham
Yeah this is Vue btw

I figured a way to do it on vanilla. It will work on Vue too

devFojo Olubo
screenshot

Similar to having a div inside a span, this works but is not the "recommended" standard way. Here is how one is supposed to do it paragraph.style.setProperty("--clr", "blue");

akh Amirul-Idzham Автор вопроса
devFojo Olubo
I figured a way to do it on vanilla. It will work ...

This is okay before scrolling and another one after scrolling, which is should not behave like that

akh Amirul-Idzham Автор вопроса
akh Amirul-Idzham Автор вопроса
devFojo Olubo
I figured a way to do it on vanilla. It will work ...

For short data like this: { position: sticky; top: 73px; } For long data like this: { position: sticky; top: 81px; }

akh Amirul-Idzham Автор вопроса
devFojo Olubo
What is this supposed to be?

Should be the image of another one. Without overlapping of other tr tag

akh Amirul Idzham
Should be the image of another one. Without overla...

Like it should stick without overlapping the top section?

akh Amirul-Idzham Автор вопроса
devFojo Olubo
Like it should stick without overlapping the top s...

Yeah. That's it. It has 2 layers that are both sticky positions

akh Amirul Idzham
Yeah. That's it. It has 2 layers that are both sti...

You'd have to calculate the exact point to set the top value to.

akh Amirul-Idzham Автор вопроса
devFojo Olubo
You'd have to calculate the exact point to set the...

Yeah I figured out so. Yesterday I did resolved the issue but with hard code. So it is temporary solution

akh Amirul Idzham
Yeah I figured out so. Yesterday I did resolved th...

Sure, hardcoding can be like that. You can make it dynamic with javascript

akh Amirul-Idzham Автор вопроса
devFojo Olubo
Sure, hardcoding can be like that. You can make it...

Yeah but the problem is as the title gets even longer, the hard code may no longer works, maybe need something like multiplication with a number or floating number may help. Still figuring out the best way

Похожие вопросы

Обсуждают сегодня

To kaise hai aap log ?
Hakuna Matata
29
вопрос: кто как решает вопрос с динамической подгрузкой скриптов для отдельных страниц с включенным turbo router?
Sergei Toroptsev
25
Great news for DePIN fans 🫵🏻 Synternet’s $NOIA token is now supported by ioPay, a multichain wallet from IoTeX! 🫡 https://x.com/synternet_com/status/1792589757471408572?s=46
Emilis
16
Подскажите пожалуйста, почему на mac m1 (arm) не монтируется ssh-agent сокет в собираемый образ? В системе не запущен ssh-agent и переменная среды SSH_AUTH_SOCK не задана. tes...
Eugene Shutov
4
Сообщение* в закодированном виде. То есть, просто сделать sendMessage?text=Привет бла-бла! не получится, надо в HEX переводить, и добавлять процент, типа такого: sendMessage?t...
КТ315
21
@LGCYMan @JustinKKW Q/A List 1. this part confuses me on #8: "From there, a bridge between erc20 LGXY and erc20 LGXY will be out once that swap is closed." does this mean ...
Sig | LGCY | BattleVerse L1 | BitWin
1
Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
58
А случайно нет ли в паскале штатной возможности передать указатель и количество туда где array of в качестве аргумента?
zamtmn
25
приветы , подскажите что я не так сделал , почему у меня скрипт не работает в программе Revit ? ;Autohotkey_RU IfWinActive ("ahk_exe Revit.exe") ; только в открытом Revit Gu...
Anton Terentev
2
You ever fuck a fat chick from behind and you’re missing out on a solid inch or two of penetration because of her fat ass?
Genghis Jhan
11
Карта сайта