Skip to content

Tag: javascript

Make a div smaller when scrolling

Hi i tried to make the div smaller wqhen scrolling. however i found some article that the div is small then when scroll it make bigger. i wanted the opposite. when run the image is 100% then when scroll it will be smaller. can someone help me please? i am new to this This is the code: https://codesandbox.io/s…

Insert each div inside next div (jQuery)

How can I insert div.one into his next div.two with jquery? What it is: What I want: What I tried (but it insert all div.one in every div.two): Whats my fail? Answer You were close: using the class in the preprendTo() function will of course select all the .box.two elements, instead by doing $(this).next() we…

How to create date intervals in javascript

I need to call an api, passing start and end date, but given that the interval is too wide I am thinking that I need to do several calls using smaller date intervals. This is how I am trying to set start and stop dates: but I am getting this result (start date is updated correctly but stop date doesn’t

stop counter on data attribute for multiple values

I have many divs that contain an data-attribute with a different value for each I try to print this value by counting using javascript The problem is that the counter doesn’t stop on the data-num value it counts to infinity How can i stop the counter for each one in the value of data-num for each div? A…