Javascript.RU

 
 
Опции темы Искать в теме
  #1 (permalink)  
Старый 25.05.2009, 16:25
mahno
 
Сообщений: n/a

Есть 2-a скрипта, 1-й показывает время, 2-й меню сайта.
Почему эти скрипты на одной странице вместе не работают ? Если не подключать время, то меню работает, и так же наоборот...
  #2 (permalink)  
Старый 25.05.2009, 18:03
Аватар для Gvozd
Матрос
Отправить личное сообщение для Gvozd Посмотреть профиль Найти все сообщения от Gvozd
 
Регистрация: 04.04.2008
Сообщений: 6,246

телепаты в отпуске
приведите код
  #3 (permalink)  
Старый 25.05.2009, 18:36
mahno
 
Сообщений: n/a

код очень длинный =) У меня скрипты подключаются таким образом :
один в <Body onLoad="show()">, а другой
<script language="javascript" src="script.js"> - в нём тоже есть onLoad=Menu;
</script>
  #4 (permalink)  
Старый 25.05.2009, 19:00
Аватар для Gvozd
Матрос
Отправить личное сообщение для Gvozd Посмотреть профиль Найти все сообщения от Gvozd
 
Регистрация: 04.04.2008
Сообщений: 6,246

замените эти оба onload-а на
<Body onLoad="show();Menu();">
  #5 (permalink)  
Старый 26.05.2009, 09:44
mahno
 
Сообщений: n/a

с Body не помогло (((
Вот коды скрипов:

Это часы

var dn
  c1=new Image(); c1.src="imgClok/c1.gif"
  c2=new Image(); c2.src="imgClok/c2.gif"
  c3=new Image(); c3.src="imgClok/c3.gif"
  c4=new Image(); c4.src="imgClok/c4.gif"
  c5=new Image(); c5.src="imgClok/c5.gif"
  c6=new Image(); c6.src="imgClok/c6.gif"
  c7=new Image(); c7.src="imgClok/c7.gif"
  c8=new Image(); c8.src="imgClok/c8.gif"
  c9=new Image(); c9.src="imgClok/c9.gif"
  c0=new Image(); c0.src="imgClok/c0.gif"
  cb=new Image(); cb.src="imgClok/cb.gif"
  cam=new Image(); cam.src="imgClok/cam.gif"
  cpm=new Image(); cpm.src="imgClok/cpm.gif"
  function extract(h,m,s,type)
   {if (!document.images)
    return
    if (h<=9)
      {document.images.a.src=cb.src
       document.images.b.src=eval("c"+h+".src")}
    else
      {document.images.a.src=eval("c"+Math.floor(h/10)+".src")
       document.images.b.src=eval("c"+(h%10)+".src")}
    if (m<=9)
      {document.images.d.src=c0.src
       document.images.e.src=eval("c"+m+".src")}
    else
      {document.images.d.src=eval("c"+Math.floor(m/10)+".src")
       document.images.e.src=eval("c"+(m%10)+".src")}
    if (s<=9)
      {document.g.src=c0.src
       document.images.h.src=eval("c"+s+".src")}
    else
      {document.images.g.src=eval("c"+Math.floor(s/10)+".src")
       document.images.h.src=eval("c"+(s%10)+".src")}
    if (dn=="AM") document.j.src=cam.src
    else document.images.j.src=cpm.src}
  function show3()
    {if (!document.images)
       return
     var Digital=new Date()
     var hours=Digital.getHours()
     var minutes=Digital.getMinutes()
     var seconds=Digital.getSeconds()
     dn="AM" 
     if ((hours>=12)&&(minutes>=1)||(hours>=13))
       {dn="PM"
        hours=hours-12}
     if (hours==0)
     hours=12
     extract(hours,minutes,seconds,dn)
     setTimeout("show3()",1000)}
  #6 (permalink)  
Старый 26.05.2009, 09:46
mahno
 
Сообщений: n/a

с body не помогло(((
Это меню - два скрипта , 1-й подключается в <head> (думаю 1-я часть не причём) , а 2-й в теле, после <body>:

2-й:

//Variables to set
between=28 //The pixel between the menus and the submenus
mainheight=25 //The height of the mainmenus
subheight=22 //The height of the submenus
pxspeed=13 //The pixel speed of the animation
timspeed=15 //The timer speed of the animation
menuy=80 //The top placement of the menu.
menux=0 //The left placement of the menu
//Images - Play with these
level0_regular="level0_regular.gif"
level0_round="level0_round.gif"
level1_regular="level1_regular.gif"
level1_round="level1_round.gif"
level1_sub="level1_sub.gif"
level1_sub_round="level1_sub_round.gif"
level1_round2="level1_round2.gif"
level2_regular="level2_regular.gif"
level2_round="level2_round.gif"

//Leave this line
preLoadBackgrounds(level0_regular,level0_round,level1_regular,level1_round,level1_sub,level1_sub_round,level1_round2,level2_regular,level2_round)


//There are 3 different types of menus you can make
//top = Main menus
//sub = Sub menus
//sub2 = SubSub menus

//You control the look of the menus in the stylesheet

//makeMenu('TYPE','TEXT','LINK','TARGET', 'END (THE LAST MENU)')

//Menu 0 
makeMenu('top','???????')
	makeMenu('sub','Newest news','/news/index.asp')
	makeMenu('sub','News archive','/news/archive.asp')

//Menu 1
makeMenu('top','Scripts')
	makeMenu('sub','New scripts','/script/search.asp?new=1')
	makeMenu('sub','All scripts','/script/index.asp')
	makeMenu('sub','Categories')
	  makeMenu('sub2','Menu scripts','/script/search.asp?category=menu')
	  makeMenu('sub2','Text scripts','/script/search.asp?category=text')
	  makeMenu('sub2','Animation scripts','/script/search.asp?category=animation')
	  makeMenu('sub2','Other scripts','/script/search.asp?category=other')        

//Menu 2    
makeMenu('top','Tutorials')
  makeMenu('sub','Tutorials','/tutorials/index.asp')
//Menu 3
makeMenu('top','Forums')
  makeMenu('sub','Cool sites','forums/forum.asp?FORUM_ID=1&CAT_ID=1&Forum_Title=Cool+sites')
  makeMenu('sub','CoolMenus','forums/forum.asp?FORUM_ID=2&CAT_ID=1&Forum_Title=CoolMenus')
  makeMenu('sub','Crossbrowser','forums/forum.asp?FORUM_ID=3&CAT_ID=1&Forum_Title=Crossbrowser+DHTML')
  makeMenu('sub','Scripts','forums/forum.asp?FORUM_ID=4&CAT_ID=1&Forum_Title=DHTML+Scripts')
  makeMenu('sub','dhtmlcentral.com','forums/forum.asp?FORUM_ID=5&CAT_ID=1&Forum_Title=dhtmlcentral%2Ecom')
  makeMenu('sub','General','forums/forum.asp?FORUM_ID=6&CAT_ID=1&Forum_Title=General+DHTML+issues')
  makeMenu('sub','Off-topic','forums/forum.asp?FORUM_ID=9&CAT_ID=1&Forum_Title=Off%2Dtopic')
  makeMenu('sub','Active topics','forums/active.asp')

//Menu 4  
makeMenu('top','CoolMenus')
  makeMenu('sub','Examples','coolmenus/examples/')
  makeMenu('sub','Download','coolmenus/download.asp')
  makeMenu('sub','Tutorial','coolmenus/tutorial.asp')
  makeMenu('sub','FAQ','faq/index.asp')

//Menu 5
makeMenu('top','Resources')
  makeMenu('sub','DHTML Links','resources/default.asp')
  
//Menu 6  
makeMenu('top','dhtmlcentral')
  makeMenu('sub','dhtmlcentral','dhtmlcentral/index.asp',"",1)

//Starting the menu
onLoad=SlideMenuInit;
  #7 (permalink)  
Старый 30.05.2009, 10:37
mahno
 
Сообщений: n/a

Хелп! Мне ещё что нибудь добавить?
Кто нибудь может помоч?
  #8 (permalink)  
Старый 30.05.2009, 10:53
Аватар для x-yuri
Отправить личное сообщение для x-yuri Посмотреть профиль Найти все сообщения от x-yuri
 
Регистрация: 27.12.2008
Сообщений: 4,201

а если убрать "onLoad=SlideMenuInit;"
а в body написать
<Body onLoad="show3();SlideMenuInit();">
  #9 (permalink)  
Старый 30.05.2009, 11:46
mahno
 
Сообщений: n/a

пытался , не помогает!
Там выше почитайте!
  #10 (permalink)  
Старый 30.05.2009, 11:51
Аватар для x-yuri
Отправить личное сообщение для x-yuri Посмотреть профиль Найти все сообщения от x-yuri
 
Регистрация: 27.12.2008
Сообщений: 4,201

тогда дай ссылку на страницу или выложи все необходимые для работы странички файлы (можно приаттачить к сообщению архив)
 



Опции темы Искать в теме
Искать в теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Ищу jQuery плагин для создания меню Zeboton jQuery 9 15.09.2014 15:31
Ошибка скрипта меню в IE Mortymer Элементы интерфейса 1 03.04.2009 03:58
глюк форума Gvozd Сайт Javascript.ru 11 18.03.2009 14:37