- sziku69: Szólánc.
- Luck Dragon: Asszociációs játék. :)
- sziku69: Fűzzük össze a szavakat :)
- Hieronymus: A németországi vasúthálózat
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- Magga: PLEX: multimédia az egész lakásban
- eBay-es kütyük kis pénzért
- ubyegon2: Airfryer XL XXL forrólevegős sütő gyakorlati tanácsok, ötletek, receptek
- laskr99: Processzor és videokártya szilícium mag fotók újrakezdés
- Viber: ingyen telefonálás a mobilodon
Ú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 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>
------------------------------
<!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>
-
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
- Intel Core i7 6700K / GTX 1660TI / 16GB DDR4 RAM / 500 GB SSD konfig eladó
- Samsung Galaxy S23 128GB, Kártyafüggetlen, 1 Év Garanciával
- Samsung Galaxy A53 5G 128GB, Kártyafüggetlen, 1 Év Garanciával
- Megkímélt állapotú Xbox Series X 1TB eladó. Kitisztítva és újrapasztázva!
- Gamer PC - i5 13400F, GTX 1080ti és 16gb DDR5
- Csere-Beszámítás! Asztali számítógép PC Játékra! I5 12400F / RTX 3070 / 32GB DDR4 / 500GB SSD
- Alkatrészt cserélnél vagy bővítenél? Nálunk van, ami kell! Enterprise alkatrészek ITT
- AKCIÓ! Apple Macbook Pro 16" 2019 i9 9980HK 64GB DDR4 1TB SSD Radeon Pro 5500M garanciával
- Lenovo magyar laptop billentyűzetre van szükséged? Akármelyik verzióban segítünk!
- Hp Prodesk 600 G3/ G5/ G6 SFF-MT / i5 8-9-10 gen, Hp EliteDesk 800 G4 / Win11- Számla, garancia
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft
Város: Budapest