Hello people I was refactoring some code and couldn’t figure a way to reuse the ‘this’: a/ Code I have b/ I want to move the function to another file and export it as: and use it like: but ‘this’ is undefined.. how do I bind it? Answer Pass this as parameter to function (and also…
Tag: html
How to make forms stay in place when HTML display data is blank
I’m trying to make a form field stay in place whenever the HTML display data part is blank. The form field does stay in place whenever the display data part is filled in, but when it is blank, the form field moves upward and indents slightly to the right. I’m trying to code it in a way that when i…
Unknown problem with (probably) POST method
This task is quite simple but I just can’t seem to get it to work. What the outcome should be is explained in the picture below. I guess that there is some kind of a problem with POST in php, but I’m not sure. Do you see what’s the problem that’s causing this not to work? Problem: No r…
How to make navbar change color on scroll?
I have a transparent nav bar which on scroll is transparent. This means that if i were to scoll to a place that did not have a solid background color it would clash with other elements such as text. I would like to transtition into a different color to make it stand out more (including making the logo and a
filter value of select to do a partial sum
Having two classes professor and student: professor.ts student.ts To add up the scores of each student relative to his teacher I did: This is the HTML of the page: How can I do a partial sum of the selections, assuming for example that I have 5 professor with 1 student for every professor, and want to add onl…
Possible to execute script when loading local html file?
I am clicking on a link and loading in an html file which consist of: I then add this into a div on my page and it looks like: the script never executes… What am I missing? Loading the html like this: Answer Yep, modifying innerHTML won’t evaluate the script tags it inserts. You might want to do s…
How to make this drop down menus appear on click rather than on hover?
I was following a tutorial on how to create this nice looking sidebar that expands when hovering and fade in elements but it has a dropdown menu that expands when hovering as well (the desktop version) and I need it to expand only when clicking it. If you hover over Profile and Notifications menu items they t…
Setting the size for an antd select component options list
The HTML select element uses an attribute size to determine how many rows should be visible at one time in a scrolling select element. The code below uses size=”4″ to show 4 options at once. I would like to know how to get that same functionality using the Ant Design Select component in a React ap…
how to ovelap a image on other image by styling scss in reactjs?
I have a design. In this design, one is overlapping on another image. I have created some code to try as given in the design. but it’s not working for me. Click here to find the design Below is some line of code of components. that is tried by me below is a style in scss Click Here to check
css replace word in centered sentence and have the width smoothly readjust
I’m looking for an effect like the primary one on this page https://sendgrid.com/ The page shows a centered sentence, a word is replaced, the sentence parts left and right to the word, smoothly readjust position according to the new word width. This code makes the parts snap into place after a word is r…