Hirdetés
- Házi barkács, gányolás, tákolás, megdöbbentő gépek!
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Vezetékes FEJhallgatók
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Milyen videókártyát?
- Sony MILC fényképezőgépcsalád
- Kihúzhatja a gyufát a PC-s gyártóknál az érkező új Xbox
- Fejhallgató erősítő és DAC topik
- Milyen alaplapot vegyek?
- Kockázatmentesen a helyesebb testtartásért
Új hozzászólás Aktív témák
-
Helló skacok. Lenne egy kérdésem. Van arra megoldás, hogy ebben a kódban friss élő hírek fussanak a "News Item 1 | News Item 2 | News Item 3" helyett? Remélem, hogy csináltatok már ilyet...köszi, ha tudtok adni tanácsot.
<!DOCTYPE html>
<html>
<head>
<style>
.news-container {
display: flex;
justify-content: flex-end;
align-items: center;
height: 50px;
background-color: lightgray;
}
.news-item {
padding: 10px;
font-size: 20px;
color: black;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<div class="news-container">
<marquee class="news-item" behavior="scroll" direction="left">
News Item 1 | News Item 2 | News Item 3
</marquee>
</div>
</body>
</html>Adott 1-2 tippet a chatgpt, de nem akarnak működni, vagy valamit rosszul csinálok...
<!DOCTYPE html>
<html>
<head>
<style>
.news-container {
display: flex;
justify-content: flex-end;
align-items: center;
height: 50px;
background-color: lightgray;
}
.news-item {
padding: 10px;
font-size: 20px;
color: black;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<div class="news-container">
<marquee class="news-item" behavior="scroll" direction="left" id="news-item">
Loading news...
</marquee>
</div>
<script>
// Fetch the CNN news from an API
const apiUrl = "https://api.example.com/cnnnews";
fetch(apiUrl)
.then(response => response.json())
.then(data => {
// Update the news item text with the fetched news
const newsItem = document.getElementById("news-item");
newsItem.innerText = `CNN Breaking News: ${data.breakingNews} | CNN Latest Headlines: ${data.latestHeadlines}`;
})
.catch(error => {
console.error("Error fetching CNN news:", error);
});
</script>
</body>
</html>vagy ezt:
<!DOCTYPE html>
<html>
<head>
<style>
.news-container {
display: flex;
justify-content: flex-end;
align-items: center;
height: 50px;
background-color: lightgray;
}
.news-item {
padding: 10px;
font-size: 20px;
color: black;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<div class="news-container">
<marquee class="news-item" behavior="scroll" direction="left" id="news-item">
Loading news...
</marquee>
</div>
<script>
// Fetch the Google news from the API
const apiUrl = "https://news.google.com/home?hl=hu&gl=HU&ceid=HU:hu";
fetch(apiUrl)
.then(response => response.text())
.then(data => {
// Parse the fetched data to extract the news headlines
const parser = new DOMParser();
const htmlDocument = parser.parseFromString(data, "text/html");
const headlines = htmlDocument.querySelectorAll(".pg-c:not(.pg-c-t)");
// Concatenate the headlines into a single string
const headlinesText = Array.from(headlines)
.map(headline => headline.textContent.trim())
.join(" | ");
// Update the news item text with the fetched headlines
const newsItem = document.getElementById("news-item");
newsItem.innerText = headlinesText;
})
.catch(error => {
console.error("Error fetching Google news:", error);
});
</script>
</body>
</html>
Új hozzászólás Aktív témák
- Házi barkács, gányolás, tákolás, megdöbbentő gépek!
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Kerékpárosok, bringások ide!
- Dupla kamerával menekülne az iPhone Air a kaszától
- Garancia kérdés, fogyasztóvédelem
- Arc Raiders
- iRacing.com - a legélethűbb -online- autós szimulátor bajnokság
- Okos Otthon / Smart Home
- Vezetékes FEJhallgatók
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- További aktív témák...
- Acer Predator Helios Neo16" QHD+ IPS i9-14900HX RTX 4070 32GB 1TB NVMe gar
- T14 Gen2i 14 FHD IPS i7-1185G7 16GB 512GB NVMe magyar vbill ujjolv gar
- Eladó Lenovo LOQ laptop I5, Rtx2050, 16gb ram, 512 m2 ssd. Garancia.
- LG 55" 4K UHD AI Smart tv GARANCIÁVAL
- Bontatlan Google Pixel 10, 12GB ram 256GB rom frost/lila
- HP 150W töltők (19.5V 7.7A) kis kék, kerek, 4.5x3.0mm
- Honor 200 Lite / 8/256GB / Kártyafüggetlen / 12HÓ Garancia
- Bomba Ár! Dell Vostro 5468 - i3-6006U I 8GB I 128SSD I 14" HD I Cam I HDMI I W11 I Garancia!
- AKCIÓS! Microsoft Surface Pro 9 i5-1245U 16GB 512GB Kijelzőrepedt!
- LG 48C3 - 48" OLED evo - 4K 120Hz 1ms - NVIDIA G-Sync - FreeSync Premium - HDMI 2.1 - A9 Gen6 CPU
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


