Очень новичок в HTML, я отлаживал большую часть этого, но контент (в настоящее время заполнителя) не будет отображаться ни для одного из элементов левой железной дороги. Например, левые имели рельсовый элемент "Neuroscience-Concept1", должен отображать латинский текст в этом разделе. Но все они показывают как пустые. Как я могу это исправить?
Home Category 1
[*]Home Category 2
[*]Home Category 3
[/list]
Placeholder 1
[*]Placeholder 2
[*]Placeholder 3
[/list]
Welcome to the Psychology of Design
Profound and inspirational introduction. Not sure it makes sense to have a left hand rail here, so
will probably lose that. Also, lots of latin. Ad lorum ipsum ignoramus.
OtherDiscussion1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Home Category 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Home Category 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Home Category 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Placeholder1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Placeholder2
Ut ornare lectus sit amet est. Ligula ullamcorper malesuada proin libero nunc. Sed cras ornare
arcu dui. Fames ac turpis egestas maecenas pharetra convallis posuere morbi leo.
Placeholder3
Fringilla phasellus faucibus scelerisque eleifend donec.
// JavaScript for handling top nav and left rail links
const topNavLinks = document.querySelectorAll('.top-nav a');
const leftRailLinks = document.querySelectorAll('.left-rail a');
const leftRails = document.querySelectorAll('.left-rail');
const sections = document.querySelectorAll('.section');
// Function to activate top nav and show corresponding left rail and content
topNavLinks.forEach(link => {
link.addEventListener('click', function (event) {
event.preventDefault();
// Hide all sections
leftRails.forEach(rail => rail.style.display = 'none');
sections.forEach(section => section.classList.remove('active'));
// Show the corresponding section
const targetId = link.getAttribute('data-target');
const targetSection = document.getElementById(targetId);
// Always show the corresponding left rail
const targetLeftRail = document.getElementById(`${targetId}-rail`);
if (targetLeftRail) {
targetLeftRail.style.display = 'block';
}
if (targetSection) {
targetSection.classList.add('active');
}
});
});
// Function to handle left rail navigation clicks
leftRailLinks.forEach(link => {
link.addEventListener('click', function (event) {
event.preventDefault();
// Hide all content sections by default
sections.forEach(section => section.classList.remove('active'));
// Show the corresponding content section
const targetSection = document.getElementById(link.getAttribute('data-target'));
if (targetSection) {
targetSection.classList.add('active');
}
});
});
// Initial page load: Ensure that Home section is shown without left rail
document.querySelector('a[data-target="home"]').click();
< /code>
Я попробовал ряд изменений, ни один из которых не сработал. Каждый элемент левого рельса имеет пример текста (некоторые примечания для меня, какой -то просто латинский текст заполнителя), который должен отображаться, но все элементы навигации левой ручки просто отображают пустую страницу.
Подробнее здесь: https://stackoverflow.com/questions/794 ... displaying
Почему контент для левых рельсов не отображается? ⇐ Html
Программисты Html
-
Anonymous
1739642631
Anonymous
Очень новичок в HTML, я отлаживал большую часть этого, но контент (в настоящее время заполнителя) не будет отображаться ни для одного из элементов левой железной дороги. Например, левые имели рельсовый элемент "Neuroscience-Concept1", должен отображать латинский текст в этом разделе. Но все они показывают как пустые. Как я могу это исправить?
[list]
[*][url=#]Home[/url]
[*][url=#]Psychology Concepts[/url]
[*][url=#]NeuroScience Concepts[/url]
[*][url=#]Other Discussion1[/url]
[*][url=#]Other Discussion2[/url]
[/list]
[url=#]Home Category 1[/url]
[*][url=#]Home Category 2[/url]
[*][url=#]Home Category 3[/url]
[/list]
[url=#]Placeholder 1[/url]
[*][url=#]Placeholder 2[/url]
[*][url=#]Placeholder 3[/url]
[/list]
Welcome to the Psychology of Design
Profound and inspirational introduction. Not sure it makes sense to have a left hand rail here, so
will probably lose that. Also, lots of latin. Ad lorum ipsum ignoramus.
OtherDiscussion1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Home Category 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Home Category 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Home Category 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Placeholder1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Placeholder2
Ut ornare lectus sit amet est. Ligula ullamcorper malesuada proin libero nunc. Sed cras ornare
arcu dui. Fames ac turpis egestas maecenas pharetra convallis posuere morbi leo.
Placeholder3
Fringilla phasellus faucibus scelerisque eleifend donec.
// JavaScript for handling top nav and left rail links
const topNavLinks = document.querySelectorAll('.top-nav a');
const leftRailLinks = document.querySelectorAll('.left-rail a');
const leftRails = document.querySelectorAll('.left-rail');
const sections = document.querySelectorAll('.section');
// Function to activate top nav and show corresponding left rail and content
topNavLinks.forEach(link => {
link.addEventListener('click', function (event) {
event.preventDefault();
// Hide all sections
leftRails.forEach(rail => rail.style.display = 'none');
sections.forEach(section => section.classList.remove('active'));
// Show the corresponding section
const targetId = link.getAttribute('data-target');
const targetSection = document.getElementById(targetId);
// Always show the corresponding left rail
const targetLeftRail = document.getElementById(`${targetId}-rail`);
if (targetLeftRail) {
targetLeftRail.style.display = 'block';
}
if (targetSection) {
targetSection.classList.add('active');
}
});
});
// Function to handle left rail navigation clicks
leftRailLinks.forEach(link => {
link.addEventListener('click', function (event) {
event.preventDefault();
// Hide all content sections by default
sections.forEach(section => section.classList.remove('active'));
// Show the corresponding content section
const targetSection = document.getElementById(link.getAttribute('data-target'));
if (targetSection) {
targetSection.classList.add('active');
}
});
});
// Initial page load: Ensure that Home section is shown without left rail
document.querySelector('a[data-target="home"]').click();
< /code>
Я попробовал ряд изменений, ни один из которых не сработал. Каждый элемент левого рельса имеет пример текста (некоторые примечания для меня, какой -то просто латинский текст заполнителя), который должен отображаться, но все элементы навигации левой ручки просто отображают пустую страницу.
Подробнее здесь: [url]https://stackoverflow.com/questions/79440941/why-is-the-content-for-the-left-rail-items-not-displaying[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия