---
Полезные скрипты
Сообщений 1 страница 14 из 14
Поделиться22013-07-27 17:16:29
Выделить код
в HTML низ
<script type="text/javascript">
function select_text(elem) {
if(window.getSelection) {
var s=window.getSelection();
if(s.setBaseAndExtent){
s.setBaseAndExtent(elem,0,elem,elem.innerText.length-1);
}
else {
var r=document.createRange();
r.selectNodeContents(elem);
s.removeAllRanges();
s.addRange(r);
}
}
else if(document.getSelection){
var s=document.getSelection();
var r=document.createRange();
r.selectNodeContents(elem);
s.removeAllRanges();
s.addRange(r);
}
else if(document.selection){
var r=document.body.createTextRange();
r.moveToElementText(elem);
r.select();
}
}
</script>
<script type="text/javascript">
var div = document.getElementById('pun-main').getElementsByTagName('div');
for(x in div){
if(div[x].className=='code-box'){
div[x].getElementsByTagName('strong')[0].innerHTML = '<a href="#" onclick="select_text(this.parentNode.parentNode.childNodes[1].getElementsByTagName(\'pre\')[0]); return false;">Выделить код</a>';
}
}
</script>Поделиться32013-07-27 17:20:41
Пиар-вход
в Объявление или в HTML низ
<style>.Myimge {position:absolute;margin-top:-14px;}</style>
<script type="text/javascript">
PiarNik="PR";
PiarPas="1111";
var L="<div id=\"PR_loginDiv\" style=\"display:none;\">\
<form id=\"form_login\" name=\"login\" method=\"post\" action=\"login.php?action=in\" onsubmit=\"return check_form()\">\
<fieldset>\
<input type=\"hidden\" name=\"form_sent\" value=\"1\"/>\
<input type=\"text\" id=\"fld1\" name=\"req_username\" size=\"21\" maxlength=\"25\"/>\
<input type=\"text\" id=\"fld2\" name=\"req_password\" size=\"7\" maxlength=\"16\"/>\
<input type=\"submit\" class=\"button\" name=\"login\"/>\
</fieldset>\
</form>\
</div>\
<span id=spMyimg><img class=\"Myimge\" title=\"Быстрый вход для 'Пиарщиков'\" onclick=\"PiarIn()\" src=\"http://savepic.ru/2867133.png\" onmouseover=\"this.src='http://savepic.ru/2857917.png' \" onmouseout=\"this.src='http://savepic.ru/2867133.png'\" /></span>";
if($("#navlogin").html()!=null){
$("#navlogin").append(L) //navlogin
$("#PR_loginDiv #fld1").val(PiarNik)
$("#PR_loginDiv #fld2").val(PiarPas)
function PiarIn () {$("#PR_loginDiv input[type='submit']").click();}
}
</script>Поделиться42013-07-27 17:21:59
Сдвигаем рекламный баннер
Вставлять в стиль
<style>#pun-title table tbody tr .title-logo-tdr {position: absolute; z-index: 1; left:50px; top:310px
}</style>или
#pun-title table tbody tr .title-logo-tdr {position: absolute; z-index: 1; left:50px; top:310px
}Поделиться52013-07-27 17:22:38
Кнопки вверх и вниз
Вставлять в HTML-верх
<!--Кнопки вверх вниз--> <div style="position:fixed; right :0.5%; bottom: 45%;"> <a href=#top onClick="scrollTo(0,0); return false;" title="Вверх страницы"> <img src="адрес картинки вверх" alt="Вверх страницы" ></a> <br/> <a href=#top onClick="scrollTo(0, document.body.scrollHeight); return false;" title="Вниз страницы"> <img src="адрес картинки вниз" alt="Вниз страницы" ></a> </div>
Поделиться62013-07-27 17:25:25
Спойлер наград в профиле
Вставлять в HTML-низ
<!-- спойлер наград на Rusff в Профиле, в Топике -->
<style>
.post-author-Sp{
/*background-color:#!important;*/
}
img.aw{
background-color:#!important;
}
ul.wrapper{
margin-left:-15px;
width:167px!important;
margin-bottom:-15px;
display:none;
}
ul.wrapper,
ul.wrapper li.pa-awards{
border-color:transparent;
}
</style>
<script>
// кнопка - ссылка на Картинку
var Img="ссылка на картинку";
wrapp1="<li class='post-author-Sp'><img class=aw style='cursor:pointer' src='";
wrappEnd="'><ul class=wrapper></ul></li>";
wrapp1=wrapp1+Img+wrappEnd;
$(window).load(function () {
$(".post .post-author .pa-awards").each(function() {
if($(this).css("display")!="none"){
$(this).before(wrapp1);a=$(this).parents('.post').find('.post-author-Sp ul')
$(this).appendTo(a)
}
});});
$(".post .post-author-Sp ").live("click", function(){
$(this).find('ul:first').toggle('slow')
});</script>
<!--Конец//=спойлер наград в Профиле, в Топике-->
Поделиться72013-07-27 17:25:57
Замена ссылок Профиль, ЛС, Email картинками
<script type="text/javascript">
var trr=document.getElementsByTagName("ul")
var fi=0
for (fi=0; fi<=(trr.length-1);fi++)
{if (trr[fi].innerHTML.indexOf("pl-email")!=-1)
{var drr=trr[fi].getElementsByTagName("a")
drr[0].innerHTML="<img src='картинка Профиль' />"
drr[1].innerHTML="<img src='картинка ЛС' />"
drr[2].innerHTML="<img src='картинка Email' />"
}}
</script>Поделиться82013-07-27 17:26:18
Бегущая строка с остановкой при наведении
<marquee scrollAmount="3" onmouseover="this.scrollAmount=0" onmouseout="this.scrollAmount=3" width="510" height="20"> .Тут текст. </marquee>
Поделиться92013-07-27 17:27:39
смена картинок навигации при наведении курсора
<script><!--Свои картинки в панель навигации со сменой картинки по наведению курсора" -->
navlinks=new Array(
"navindex", // Форум
"без наведения","при наведение",
"navuserlist", // Участники
"без наведения","при наведение",
"navsearch", // Поиск
"без наведения","при наведение",
"navprofile", // Профиль
"без наведения","при наведение",
"navpm", // Сообщения
"без наведения","при наведение",
"navadmin", // Администрирование
"без наведения","при наведение",
"navregister", // Регистрация
"без наведения","при наведение",
"navlogin", // Войти
"без наведения","при наведение",
"navlogout", // Выход
"без наведения","при наведение" // !ПОСЛЕДНИЙ элемент без запятой
)
var s0,s1,s2,s3,i; for (i=0; i < navlinks.length; i++){s0=navlinks[i+1];s1="onmouseover=\"this.src='"+navlinks[i+2]+"'\""; s2="onmouseout=\"this.src='"+s0+"'\"";s3='<img class="navlinks" src="'+s0+'" '+s1+' '+s2+' border="0" />';$("#"+navlinks[i]+" a").html("<span>"+s3+"</span>");i++;i++; }
</script>Поделиться102013-07-27 17:27:59
замена ссылок в навигации на картинки
<script>
<!--
indexof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navindex").innerHTML
pos = str.indexOf("Форум")
document.getElementById("navindex").innerHTML=str.substring(0,pos)+indexof+str.substring(pos+5,str.length-1)
--></script>
<script>
<!--
userof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navuserlist").innerHTML
if( (pos=str.indexOf("Участники")) != -1 )
document.getElementById("navuserlist").innerHTML=str.substring(0,pos)+userof+str.substring(pos+9,str.length-1)
--></script>
<script>
<!--
findof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navsearch").innerHTML
pos = str.indexOf("Поиск")
document.getElementById("navsearch").innerHTML=str.substring(0,pos)+findof+str.substring(pos+5,str.length-1)
--></script>
<script>
<!--
pravilof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navrules").innerHTML
pos = str.indexOf("Правила")
document.getElementById("navrules").innerHTML=str.substring(0,pos)+pravilof+str.substring(pos+14,str.length-1)
-->
</script>
<script>
<!--
faseof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navprofile").innerHTML
pos = str.indexOf("Профиль")
document.getElementById
("navprofile").innerHTML=str.substring(0,pos)+faseof
+str.substring(pos+14,str.length-1)
-->
</script>
<script>
<!--
pismaof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navpm").innerHTML
pos = str.indexOf("Сообщения")
document.getElementById("navpm").innerHTML=str.substring
(0,pos)+pismaof+str.substring(pos+9,str.length-1)
-->
</script>
<script>
<!--
godof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navadmin").innerHTML
pos = str.indexOf("Администрирование")
document.getElementById("navadmin").innerHTML=str.substring
(0,pos)+godof+str.substring(pos+17,str.length-1)
-->
</script>
<script>
<!--
valiof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navlogout").innerHTML
pos = str.indexOf("Выход")
document.getElementById("navlogout").innerHTML=str.substring
(0,pos)+valiof+str.substring(pos+5,str.length-1)
-->
</script>
<script>
<!--
vxodiof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navlogin").innerHTML
pos = str.indexOf("Войти")
document.getElementById("navlogin").innerHTML=str.substring
(0,pos)+vxodiof+str.substring(pos+5,str.length-1)
-->
</script>
<script>
<!--
regof="<img src='ССЫЛКА НА КАРТИНКУ' />"
str = document.getElementById("navregister").innerHTML
pos = str.indexOf("Регистрация")
document.getElementById
("navregister").innerHTML=str.substring(0,pos)+regof
+str.substring(pos+18,str.length-1)
-->
</script>Поделиться112013-07-27 17:59:14
Убрать Название форума
<style type="text/css">
#pun-title h1 span {display: none;}
</style>Поделиться122013-07-27 18:00:23
Цвет линии , отделяющий подпись
<style>
#pun #pun-viewtopic #pun-main .topic .container .post-body .post-box .post-content .post-sig dt {background-color: red}
</style>Поделиться132013-07-27 18:02:02
Убрать слово "Обьявление"
<style>
#pun #pun-index #pun-announcement h2 span {display: none}
</style>Поделиться142013-07-28 17:18:38
Убрать слово "Обьявление"