Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Спойлер

Опубликовано:

В общем такой вопрос. Есть код спойлер все прекрасно работает. Но мне нужно чтобы вместо слова спойлер можно было свое название вводить, как это сделать не хватает сил(.

Вот код: и извините если не туда

<script language='JavaScript' type="text/javascript">
<!--

function getPostObj(id) {
itm = null;
if (document.getElementById) {
 itm = document.getElementById(id);
}
else if (document.all) {
 itm = document.all[id];
}
else if (document.layers) {
 itm = document.layers[id];
}
return itm;
}

function layer(layer_id) {
 var full_head = "Скрыть";
 var short_head = "Показать";
 var id = document.getElementById("layer_" + layer_id);
 var head = document.getElementById("a_layer_" + layer_id);
 if (id.style.display == "none") {
  head.innerHTML = " <img src=\"http://ipb.su/uploads/rolevoysu/web/post-1-1428930084.gif\" border=\"0\" /> " + full_head;
  id.style.display = "";
 }
 else {
  head.innerHTML = " <img src=\"http://ipb.su/uploads/rolevoysu/web/post-1-1428930077.gif\" border=\"0\" /> " + short_head;
  id.style.display = "none";
 }
}
 function changePost(id, author) {
 var PostValue = getPostObj(id).innerHTML;

 // Спойлер
 var date = new Date();
 while(PostValue.indexOf("[sP]")!=-1 && PostValue.indexOf("[/sP]")!=-1 ) {
 if (PostValue.indexOf("[sP]") > PostValue.indexOf("[/sP]")) {
PostValue = PostValue.replace("[/sP]","[плохой тег]");
 } else {
var i = date.getTime() + "" + Math.round(Math.random() * 100) + 1;
PostValue = PostValue.replace("[sP]", '<div class="sp-wrap" id="a_layer_' + i + '" onclick="layer(\'' + i + '\'); return false;"> <img src="http://ipb.su/uploads/rolevoysu/web/post-1-1428930077.gif" border="0" /> Показать</div><div class="sp-body"id="layer_' + i + '" style="display: none"><div></div>');
PostValue = PostValue.replace("[/sP]", "</div>");
 }
 }

// другие теги 

  // выводим конечный результат
  getPostObj(id).innerHTML = PostValue;
}

//-->
</script>

Рекомендованные сообщения

Опубликовано:

а где это слово "спойлер" у вас задействовано? в коде его нет

Опубликовано:
  • Автор
а где это слово "спойлер" у вас задействовано? в коде его нет

 

там вместо спойлер идет [sP][/sP]

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.