У меня есть ссылки, которые после щелчка будут отображать содержимое, а затем все содержимое будет отображаться после повторного нажатия. Я использую документы Google, и это не сработает. Я также использую CSS. Ссылки показывают, что javascript и CSS не будут компилироваться для меня или других.Стиль JavaScript и CSS не работает на моей странице «Сайты Google»?
function toggle() {
\t var ele = document.getElementById("toggleText");
\t var text = document.getElementById("displayText");
\t if(ele.style.display == "block") {
\t \t ele.style.display = "none";
\t \t text.innerHTML = "Musis List";
\t }
\t else {
\t \t ele.style.display = "block";
\t \t text.innerHTML = "Musis List ▼";
\t }
}
#title a:link { color: #38761D; text-decoration: none !important; }
#title a:visited {
\t color: #38761D; text-decoration: none !important;
}
#title a:hover{
\t color: #4EA628;
\t background-color:transparent;
\t text-decoration: none !important;
}
#title a:active {
\t color: #4EA628; text-decoration: none !important;
}
#title a {
\t text-decoration: none !important;
\t display:block;
\t border-bottom: 0px solid #38761D;
\t font-family: Verdana, sans-serif;
\t font-weight: bold;
\t font-size: large; \t
\t line-height: 1.26;
}
<center>
<div id="title" >
<a id="displayText" href="javascript:toggle();">Musis List</a>
</div>
<div id="toggleText" style="display: none">
Here will be a list of music....
</div>
<br />
<br />
<br />
<script language="javascript">
function toggle1(id) {
\t var ele = document.getElementById("toggleText1");
\t var text = document.getElementById("displayText1");
\t if(ele.style.display == "block") {
\t \t ele.style.display = "none";
\t \t text.innerHTML = "Video List";
\t }
\t else {
\t \t ele.style.display = "block";
\t \t text.innerHTML = "Video List ▼";
\t }
}
</script>
<div id="title" >
<a id="displayText1" href="javascript:toggle1(1);">Video List</a>
</div>
<div id="toggleText1" style="display: none">Here will be a list of videos....</div>
</center>
Позвольте мне знать, если кто-то может помочь. Я оценил помощников.
Упомянутое решение зависит от устаревшей функции Google Drive, с помощью другой стороны, ответ должен включать наиболее значимые части связанного ресурса. –