it is required due to pseudo thingy
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
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
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
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)?
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
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
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
I guess so, perhaps need to find another way
Yeah this is Vue btw
I figured a way to do it on vanilla. It will work on Vue too
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");
This is okay before scrolling and another one after scrolling, which is should not behave like that
For short data like this: { position: sticky; top: 73px; } For long data like this: { position: sticky; top: 81px; }
What is this supposed to be?
Should be the image of another one. Without overlapping of other tr tag
Like it should stick without overlapping the top section?
Yeah. That's it. It has 2 layers that are both sticky positions
You'd have to calculate the exact point to set the top value to.
Yeah I figured out so. Yesterday I did resolved the issue but with hard code. So it is temporary solution
Sure, hardcoding can be like that. You can make it dynamic with javascript
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
Обсуждают сегодня