- Mégis mi értelme az Xbox PC-nek, ha limitálja a hardverválasztékot?
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Milyen notebookot vegyek?
- SCUF Reflex (2025): Apró változtatás, hatalmas különbség?
- Mikrokontrollerek Arduino környezetben (programozás, építés, tippek)
- Azonnali fotós kérdések órája
- iPad topik
- Hobby elektronika
- TCL LCD és LED TV-k
- Autós kamerák
Ú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
- Mégis mi értelme az Xbox PC-nek, ha limitálja a hardverválasztékot?
- E-roller topik
- Allegro vélemények - tapasztalatok
- Flint 2 OFF topik
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Autós topik
- Honor Magic7 Pro - kifinomult, költséges képalkotás
- Xbox Series X|S
- Napelem
- Milyen notebookot vegyek?
- További aktív témák...
- Telefon felvásárlás!! Honor Magic6 Lite, Honor Magic6 Pro, Honor Magic7 Lite, Honor Magic7 Pro
- Vállalom Xiaomi Okoskamerák szoftveres javíttását
- BESZÁMÍTÁS! MSI B450 R5 5600X 16GB DDR4 512GB SSD 1TB HDD RX 5700 XT 8GB ZALMAN S3 TG Chieftec 600W
- Eladó Apple iPhone 14 Pro 128GB Arany / 12 hó jótállás
- ÚJ HP EliteBook 840 G8 - 14"FHD IPS - i5-1145G7 - 32GB - 512GB SSD - Win10 PRO - Garancia
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest