coding with ☕️
2 subscribers
262 photos
14 videos
11 files
165 links
Anwendungsentwicklung
Download Telegram
const timers = document.querySelectorAll(".timer");
const item = document.querySelector(".item");
window.addEventListener("scroll", function luboy() {
console.log(this.scrollY + 2 * item.clientHeight);
console.log(item.offsetTop);

timers.forEach((time) => {
function rec(i = 0) {
time.innerHTML = i;
i++;
let count = +time.getAttribute("count");
if (i <= count) {
setTimeout(() => {
rec(i);
}, 10);
}
}
rec();
});
this.window.removeEventListener('scroll', luboy)
});
PageX - card ni o'lchaydi
OffsetX - card dan tashqarini o'lchaydi
btn.onclick = () => {
root.style.setProperty("--color',gold")
localStorage.setItem('color', 'gold')

}
btn.ondblclick = () => {
root.style.setProperty("--color',green")
localStorage.setItem('color', 'green')

}
})
root.style.setProperty('--color', localStorage.getItem("color"))
function Person (firstName, lastName) {
this.firstName = firstName
this.lastName = lastName
}

const firstPerson = new Person("Fotima", "Nishonova")
const secondPerson = new Person("Zuhra", "Nishonova")

console.log(firstPerson);
console.log(secondPerson);
this.hello = function() {
console.log(`Hello ${this.firstName} ${this.lastName} `); firstPerson.hello()
secondPerson.hello()
function hello() {
console.log("Salom, dunyo!");
}
hello(); // Funksiyani chaqirish
function sayHello(name) {
console.log("Salom, " + name + "!");
}
sayHello("Ali"); // Chaqirish: Salom, Ali!
function sum(a, b) {
return a + b;
}
let result = sum(5, 3); // Chaqirish
console.log(result); // Natija: 8
let greet = function(name) {
return "Salom, " + name + "!";
};
console.log(greet("Hasan")); // Chaqirish
const multiply = (a, b) => a * b;
console.log(multiply(4, 2)); // Chaqirish: 8