Hirdetés
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- gerner1
- eBay-es kütyük kis pénzért
- Luck Dragon: Asszociációs játék. :)
- Brogyi: CTEK akkumulátor töltő és másolatai
- Trewerr: Analóg-digitális jelátalakítás (zenefájlok leegyszerűsítésével magyarázva)
- Meggyi001: A kérdés...
- hcl: Xiaomi pumpa pumpálás
- Mr Dini: Mindent a StreamSharkról!
- gban: Ingyen kellene, de tegnapra
Új hozzászólás Aktív témák
-
válasz
Meggyi001
#21292
üzenetére
Bocsi, nem formáztam
<!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>
--------------------------<!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 APIconst apiUrl = "https://api.example.com/cnnnews";fetch(apiUrl).then(response => response.json()).then(data => {// Update the news item text with the fetched newsconst 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>------------------------------
<!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 APIconst 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 headlinesconst 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 stringconst headlinesText = Array.from(headlines).map(headline => headline.textContent.trim()).join(" | ");// Update the news item text with the fetched headlinesconst newsItem = document.getElementById("news-item");newsItem.innerText = headlinesText;}).catch(error => {console.error("Error fetching Google news:", error);});</script></body></html> -
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
- Samsung Galaxy Watch (Tizen és Wear OS) ingyenes számlapok, kupon kódok
- Konzolokról KULTURÁLT módon
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- 5.1, 7.1 és gamer fejhallgatók
- Elektromos cigaretta 🔞
- LG LCD és LED TV-k
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- BestBuy topik
- Black Friday november 29. / Cyber Monday december 2.
- Fejhallgató erősítő és DAC topik
- További aktív témák...
- Gamer PC-Számítógép! Csere-Beszámítás! R5 5500 / RX 5700XT 8GB / 32GB DDR4 / 500GB SSD
- Telefon felvásárlás!! Honor 90 Lite/Honor 90/Honor Magic5 Lite/Honor Magic6 Lite/Honor Magic5 Pro
- ÁRGARANCIA! Épített KomPhone Ultra 9 285K 64GB RAM RTX 5090 32GB GAMER PC termékbeszámítással
- Bomba ár! Dell Latitude 5530 - i5-1240P I 16GB I 256SSD I HDMI I 15,6" FHD I Cam I W11 I Gari!
- Xiaomi Mi 10T Lite 128GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

