Перейти к контенту

Выпадающая менюшка


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

Итак, в ACP Home / Skin Manager Home / All Global HTML / global_board_header

 

под

<script type="text/javascript" src='jscripts/ipb_global.js'></script>

 

вставляем

<script type='text/javascript' src='jscripts/dmenu.js'></script>

 

и в произвольном месте среди кнопок -

<span id='gbartab'><a href='#gbarlinks'>Extra Stuff <img src='style_images/dmenu/sort_desc.gif' border='0' alt='Extra Stuff!'></a></span>

 

Соответственно, в папке jscripts создается файл dmenu.js следующего содержания:

function tabs_init()
{
var ucptab = document.getElementById('ucptab');
var gbartab = document.getElementById('gbartab');
if (ucptab)
{
 ucptab.getElementsByTagName('a')[0].onclick = arrow_click;
}
if (gbartab)
{
 gbartab.getElementsByTagName('a')[0].onclick = arrow_click;
}

return false;
}

function arrow_click(pevt)
{
var oevt = (pevt) ? pevt : window.event;
if (pevt)
{
 oevt.stopPropagation();
}
else
{
 oevt.cancelBubble = true;
}

var id = this.href.split('#');
var ot = this.parentNode.parentNode;
var nt = (ot.offsetTop + ot.parentNode.offsetHeight);
var st = (ot.Selected) ? (nt+2-7) : (nt-1-7);

if (id[1] == 'gbarlinks')
{
 var newleft = screen.availWidth - 170;
 var st = st + 4;
}

if ((typeof curid != 'undefined' && curid) && curid == id[1])
{
 curid = 'blank';
}

hide_old_menus();
menu = document.getElementById(id[1]);
curid = id[1];
if (menu)
{
 menu.style.top = st+'px';
 menu.style.left = (newleft) ? newleft+'px' : ot.offsetLeft+'px';
 menu.onclick = menu_click;
 menu.style.visibility = (menu.style.visibility != 'visible') ? 'visible' : 'hidden';
 if (menu.style.visibility == 'hidden')
 {
	 hide_menu;
 }
}

document.onclick = hide_menu;
return false;
}

function hide_menu()
{
if (typeof menu != 'undefined' && menu)
{
 menu.style.top = 0;
 menu.style.left = -100+'px';
 menu.style.visibility = 'hidden';
 menu = null;
 document.onclick = null;
 window.onresize = null;
}
}

function hide_old_menus()
{
var om = new Array('ucptab', 'gbartab');
for (var i=0; i<om.length; i++)
{
 a = document.getElementById(om[i]).getElementsByTagName('a')[0];
 l = a.href.split('#');
 m = document.getElementById(l[1]);

 if (typeof curid != 'undefined' && curid)
 {
	 if (curid != l[1])
	 {
   continue;
	 }
 }

 if (typeof m != 'undefined' && m)
 {
	 m.style.top = 0;
	 m.style.left = -100+'px';
	 m.style.visibility = 'hidden';
	 m = null;
 }
}
}

function menu_click(pevt)
{
var oevt = (pevt) ? (pevt) : window.event;
if (pevt)
{
 oevt.stopPropagation();
}
else
{
 oevt.cancelBubble = true;
}

if (oevt && oevt.target && oevt.target.parentNode && oevt.target.parentNode.tagName == "A")
{
 window.location = oevt.target.parentNode.href;
}
}

onload = tabs_init;

 

а в style_images/dmenu/ копируется изображение sort_desc.gif, представляющее собой небольшую стрелочку.

 

Затем в каком-то месте (?) вставляется описание пунктов меню.

Оно выглядит следующим образом (также с куском менюшки для UserCP):

</table><div id='ucpextras' class='dmenu'>
  <div class='borderwrap'>
    <div class='row1'>
      <span class='dmheader'><center><a href='http://www.somehost.com/index.php?amp;act=UserCP'>UserCP Home</a></center></span>
      <hr size='1' style='color:#eeeeee;width:90%'>
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=Msg&CODE=01&VID=in'>View Inbox</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=Msg&CODE=04'>Compose Message</a>
      <hr size='1' style='color:#eeeeee;width:90%'>
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=module&module=subscription&CODE=index'>Purchase Subscriptions</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=01'>Edit Profile</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=22'>Edit Signature</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=24'>Edit Avatar</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=photo'>Edit Personal Photo</a>
      <hr size='1' style='color:#eeeeee;width:90%'>
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=04'>Board Settings</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=02'>Email Settings</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=08'>Change Email</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=UserCP&CODE=28'>Change Password</a>
    </div>
  </div>
</div>
<div id='gbarlinks' class='dmenu'>
  <div class='borderwrap'>
    <div class='row1'>
      <span class='dmheader'><center><a href='http://www.somehost.com/index.php?amp;act=idx'>Board Index</a></center></span>
      <hr size='1' style='color:#eeeeee;width:90%'>
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=affiliate'>Affiliates</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=calendar'>Calendar</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=help'>Help Page</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=membermap'>Member Map</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=members'>Members List</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=planner'>Personal Planner</a><br />
      <img src='style_images/dscript/nav_m_dark.gif' border='0'  alt='.' /> <a href='http://www.somehost.com/index.php?amp;act=search'>Search</a>
    </div>
  </div>
</div>

 

Вот, собственно, и все что я знаю. Теперь бы найти кого толкового чтоб свести это все в кучу... :D

Ссылка на комментарий
Поделиться на других сайтах

  • 2 недели спустя...
  • 2 недели спустя...

Всем приветы

 

Народ а никто не знает или может подскажет , как сделать вообще сообщение - Welcome To D-Scripting Forums Guest не исчезающим даже для пользователей ?

 

Это трудно ??

 

Хочу одну вещь у себя опробовать, может кто поможет ?

Ссылка на комментарий
Поделиться на других сайтах

Попробуй поиграйся вот с таким скриптом:

 

<html><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title>

<style type="text/css">
<!--
#sponsorAdDiv {position:absolute; height:1; width:1; top:0; left:0;}
-->
</style>

<script LANGUAGE="JavaScript1.2">

adTime=10;  // seconds ad reminder is shown
chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie)  adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns)	adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3)	adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
       if (ie||w3)
       adDiv.visibility="visible";
       else
       adDiv.visibility ="show";
if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
if (ie){documentWidth  =document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}	
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;} 
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;} 
adDiv.left=documentWidth-190;adDiv.top =documentHeight-140;
setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
onload=initAd;
//End-->
</script>

</head>
<body>

<div id="sponsorAdDiv" style="visibility:hidden">
<table width="405" height="205" bgcolor="#efe7cf"><tr><td>
<table width="400" height="200" bgcolor="#efe7cf" background="newsbg.jpg" tppabs="http://www.haiate.narod.ru/newsbg.jpg"><tr><td align="center" valign="bottom">
<!--*****EDIT THIS MESSAGE*****-->

<IMG SRC="img.gif">

<!--*****EDIT THE ABOVE MESSAGE*****-->
</td></tr></table></td></tr></table>
</div>

</body>
</html>

Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Ответить в этой теме...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.