943,552 Members | Top Members by Rank

Ad:
Dec 30th, 2008
0

java

Expand Post »
Hey. Someone should educate me on how to use java script
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gbogze is offline Offline
3 posts
since Dec 2008
Dec 30th, 2008
0

Re: java

What do you want to do?
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 30th, 2008
0

Re: java

I have a problem using two different java script codes. In using a DHMTL menu and a java scrolling text code. When I place the two together in the same page the DHMTL drop down menu does not appear while only the scrolling text appears. Is it that the two do not go together or what. Or do I still need to know something else. Please educate me because I am still new to web development. I can send the codes if you want.

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gbogze is offline Offline
3 posts
since Dec 2008
Dec 30th, 2008
0

Re: java

html Syntax (Toggle Plain Text)
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Untitled Document</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. </head>
  8.  
  9. <body>
  10. <script type='text/javascript'>
  11.  
  12. function Go(){return}
  13.  
  14. /***********************************************************************
  15. YOU CAN MANUALLY CHANGE THE MENU HERE, BUT BE VERY CAREFUL !
  16. ***********************************************************************/
  17.  
  18. Menu1=new Array("Home","http://","",0,37,120);
  19.  
  20. Menu2=new Array("Contact","http://","",0,0,120);
  21.  
  22. Menu3=new Array("Services","http://","",0,37,120);
  23.  
  24. Menu4=new Array("Advertising","http://","",0,37,120);
  25.  
  26. Menu5=new Array("Properties","http://","",0,37,120);
  27.  
  28. Menu6=new Array("Entertainment","http://","",0,37,120);
  29.  
  30. Menu7=new Array("Digital Signage","http://","",0,37,120);
  31.  
  32. Menu8=new Array("Consultancy","http://","",0,0,120);
  33.  
  34.  
  35. var NoOffFirstLineMenus=8; // Number of first level items
  36. var LowBgColor='#FF0000'; // Background color when mouse is not over
  37. var LowSubBgColor='#0080FF'; // Background color when mouse is not over on subs
  38. var HighBgColor='#00FF00'; // Background color when mouse is over
  39. var HighSubBgColor='#009CE8'; // Background color when mouse is over on subs
  40. var FontLowColor='#FFFFFF'; // Font color when mouse is not over
  41. var FontSubLowColor='#FFFFFF'; // Font color subs when mouse is not over
  42. var FontHighColor='#0000FF'; // Font color when mouse is over
  43. var FontSubHighColor='#0000FF'; // Font color subs when mouse is over
  44. var BorderColor='#000000'; // Border color
  45. var BorderSubColor='#000000'; // Border color for subs
  46. var BorderWidth=0; // Border width
  47. var BorderBtwnElmnts=1; // Border between elements 1 or 0
  48. var FontFamily="Oracle" // Font family menu items
  49. var FontSize=10; // Font size menu items
  50. var FontBold=0; // Bold menu items 1 or 0
  51. var FontItalic=0; // Italic menu items 1 or 0
  52. var MenuTextCentered='center'; // Item text position 'left', 'center' or 'right'
  53. var MenuCentered='center'; // Menu horizontal position 'left', 'center' or 'right'
  54. var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static
  55. var ChildOverlap=.2; // horizontal overlap child/ parent
  56. var ChildVerticalOverlap=.2; // vertical overlap child/ parent
  57. var StartTop=0; // Menu offset x coordinate
  58. var StartLeft=1; // Menu offset y coordinate
  59. var VerCorrect=0; // Multiple frames y correction
  60. var HorCorrect=0; // Multiple frames x correction
  61. var LeftPaddng=3; // Left padding
  62. var TopPaddng=2; // Top padding
  63. var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
  64. var MenuFramesVertical=1; // Frames in cols or rows 1 or 0
  65. var DissapearDelay=1000; // delay before menu folds in
  66. var TakeOverBgColor=1; // Menu frame takes over background color subitem frame
  67. var FirstLineFrame='navig'; // Frame where first level appears
  68. var SecLineFrame='space'; // Frame where sub levels appear
  69. var DocTargetFrame='space'; // Frame where target documents appear
  70. var TargetLoc=''; // span id for relative positioning
  71. var HideTop=0; // Hide first level when loading new document 1 or 0
  72. var MenuWrap=1; // enables/ disables menu wrap 1 or 0
  73. var RightToLeft=0; // enables/ disables right to left unfold 1 or 0
  74. var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover
  75. var WebMasterCheck=0; // menu tree checking on or off 1 or 0
  76. var ShowArrow=1; // Uses arrow gifs when 1
  77. var KeepHilite=1; // Keep selected path highligthed
  78. var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height
  79.  
  80.  
  81. /***********************************************************************
  82. DO NOT EDIT ANYTHING BELOW THIS LINE - IT WILL BREAK THE SCRIPT !
  83. ***********************************************************************/
  84.  
  85. var AgntUsr=navigator.userAgent.toLowerCase();
  86. var DomYes=document.getElementById?1:0;
  87. var NavYes=AgntUsr.indexOf('mozilla')!=-1&&AgntUsr.indexOf('compatible')==-1?1:0;
  88. var ExpYes=AgntUsr.indexOf('msie')!=-1?1:0;
  89. var Opr=AgntUsr.indexOf('opera')!=-1?1:0;
  90. var Opr6orless=window.opera && navigator.userAgent.search(/opera.[1-6]/i)!=-1 //DynamicDrive.com added code
  91. if ( Opr6orless!=1 ) { ExpYes = 1 }
  92. var DomNav=DomYes&&NavYes?1:0;
  93. var DomExp=DomYes&&ExpYes?1:0;
  94. var Nav4=NavYes&&!DomYes&&document.layers?1:0;
  95. var Exp4=ExpYes&&!DomYes&&document.all?1:0;
  96. var PosStrt=(NavYes||ExpYes)&&!Opr6orless?1:0;
  97. var FrstLoc,ScLoc,DcLoc;
  98. var ScWinWdth,ScWinHght,FrstWinWdth,FrstWinHght;
  99. var ScLdAgainWin;
  100. var FirstColPos,SecColPos,DocColPos;
  101. var RcrsLvl=0;
  102. var FrstCreat=1,Loadd=0,Creatd=0,IniFlg,AcrssFrms=1;
  103. var FrstCntnr=null,CurrntOvr=null,CloseTmr=null;
  104. var CntrTxt,TxtClose,ImgStr;
  105. var Ztop=100;
  106. var ShwFlg=0;
  107. var M_StrtTp=StartTop,M_StrtLft=StartLeft;
  108. var StaticPos=0;
  109. var LftXtra=DomNav&&!Opr?LeftPaddng:0; //Changed for Opera
  110. var TpXtra=DomNav?TopPaddng:0;
  111. var M_Hide=Nav4?'hide':'hidden';
  112. var M_Show=Nav4?'show':'visible';
  113. var Par=parent.frames[0]&&FirstLineFrame!=SecLineFrame?parent:window;
  114. var Doc=Par.document;
  115. var Bod=Doc.body;
  116. var Trigger=NavYes&&!Opr?Par:Bod; //Changed for Opera
  117.  
  118. MenuTextCentered=MenuTextCentered==1||MenuTextCentered=='center'?'center':MenuTextCentered==0||MenuTextCentered!='right'?'left':'right';
  119. WbMstrAlrts=["Item not defined: ","Item needs height: ","Item needs width: "];
  120.  
  121. if(Trigger.onload)Dummy=Trigger.onload;
  122. if(DomNav||Opr)Trigger.addEventListener('load',Go,false); //Changed for Opera
  123. else Trigger.onload=Go;
  124.  
  125. function Dummy(){return}
  126.  
  127. function CnclSlct(){return false}
  128.  
  129. function RePos(){
  130. FrstWinWdth=ExpYes?FrstLoc.document.body.clientWidth:FrstLoc.innerWidth;
  131. FrstWinHght=ExpYes?FrstLoc.document.body.clientHeight:FrstLoc.innerHeight;
  132. ScWinWdth=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
  133. ScWinHght=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
  134. if(MenuCentered=='justify'&&FirstLineHorizontal){
  135. FrstCntnr.style.width=FrstWinWdth;
  136. ClcJus();
  137. var P=FrstCntnr.FrstMbr,W=Menu1[5],i;
  138. for(i=0;i<NoOffFirstLineMenus;i++){P.style.width=W;P=P.PrvMbr}}
  139. StaticPos=-1;
  140. if(TargetLoc)ClcTrgt();
  141. if(MenuCentered)ClcLft();
  142. if(MenuVerticalCentered)ClcTp();
  143. PosMenu(FrstCntnr,StartTop,StartLeft)}
  144.  
  145. function UnLoaded(){
  146. if(CloseTmr)clearTimeout(CloseTmr);
  147. Loadd=0; Creatd=0;
  148. if(HideTop){
  149. var FCStyle=Nav4?FrstCntnr:FrstCntnr.style;
  150. FCStyle.visibility=M_Hide}}
  151.  
  152. function ReDoWhole(){
  153. if(ScWinWdth!=ScLoc.innerWidth||ScWinHght!=ScLoc.innerHeight||FrstWinWdth!=FrstLoc.innerWidth||FrstWinHght!=FrstLoc.innerHeight)Doc.location.reload()}
  154.  
  155. function Check(WMnu,NoOf){
  156. var i,array,ArrayLoc;
  157. ArrayLoc=parent.frames[0]?parent.frames[FirstLineFrame]:self;
  158. for(i=0;i<NoOf;i++){
  159. array=WMnu+eval(i+1);
  160. if(!ArrayLoc[array]){WbMstrAlrt(0,array); return false}
  161. if(i==0){ if(!ArrayLoc[array][4]){WbMstrAlrt(1,array); return false}
  162. if(!ArrayLoc[array][5]){WbMstrAlrt(2,array); return false}}
  163. if(ArrayLoc[array][3])if(!Check(array+'_',ArrayLoc[array][3])) return false}
  164. return true}
  165.  
  166. function WbMstrAlrt(No,Xtra){
  167. return confirm(WbMstrAlrts[No]+Xtra+' ')}
  168.  
  169. function Go(){
  170. Dummy();
  171. if(Loadd||!PosStrt)return;
  172. BeforeStart();
  173. Creatd=0; Loadd=1;
  174. status='Building menu';
  175. if(FrstCreat){
  176. if(FirstLineFrame =="" || !parent.frames[FirstLineFrame]){
  177. FirstLineFrame=SecLineFrame;
  178. if(FirstLineFrame =="" || !parent.frames[FirstLineFrame]){
  179. FirstLineFrame=SecLineFrame=DocTargetFrame;
  180. if(FirstLineFrame =="" || !parent.frames[FirstLineFrame])FirstLineFrame=SecLineFrame=DocTargetFrame=''}}
  181. if(SecLineFrame =="" || !parent.frames[SecLineFrame]){
  182. SecLineFrame=DocTargetFrame;
  183. if(SecLineFrame =="" || !parent.frames[SecLineFrame])SecLineFrame=DocTargetFrame=FirstLineFrame}
  184. if(DocTargetFrame =="" || !parent.frames[DocTargetFrame])DocTargetFrame=SecLineFrame;
  185. if(WebMasterCheck){ if(!Check('Menu',NoOffFirstLineMenus)){status='build aborted';return}}
  186. FrstLoc=FirstLineFrame!=""?parent.frames[FirstLineFrame]:window;
  187. ScLoc=SecLineFrame!=""?parent.frames[SecLineFrame]:window;
  188. DcLoc=DocTargetFrame!=""?parent.frames[DocTargetFrame]:window;
  189. if (FrstLoc==ScLoc) AcrssFrms=0;
  190. if (AcrssFrms)FirstLineHorizontal=MenuFramesVertical?0:1;
  191. FrstWinWdth=ExpYes?FrstLoc.document.body.clientWidth:FrstLoc.innerWidth;
  192. FrstWinHght=ExpYes?FrstLoc.document.body.clientHeight:FrstLoc.innerHeight;
  193. ScWinWdth=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
  194. ScWinHght=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
  195. if(Nav4){ CntrTxt=MenuTextCentered!='left'?"<div align='"+MenuTextCentered+"'> ":"";
  196. TxtClose="</font> "+MenuTextCentered!='left'?"</div> ":""}}
  197. FirstColPos=Nav4?FrstLoc.document:FrstLoc.document.body;
  198. SecColPos=Nav4?ScLoc.document:ScLoc.document.body;
  199. DocColPos=Nav4?DcLoc.document:ScLoc.document.body;
  200. if (TakeOverBgColor)FirstColPos.bgColor=AcrssFrms?SecColPos.bgColor:DocColPos.bgColor;
  201. if(MenuCentered=='justify'&&FirstLineHorizontal)ClcJus();
  202. if(FrstCreat){
  203. FrstCntnr=CreateMenuStructure('Menu',NoOffFirstLineMenus);
  204. FrstCreat=AcrssFrms?0:1}
  205. else CreateMenuStructureAgain('Menu',NoOffFirstLineMenus);
  206. if(TargetLoc)ClcTrgt();
  207. if(MenuCentered)ClcLft();
  208. if(MenuVerticalCentered)ClcTp();
  209. PosMenu(FrstCntnr,StartTop,StartLeft);
  210. IniFlg=1;
  211. Initiate();
  212. Creatd=1;
  213. if (AcrssFrms) //Added for Opera
  214. { //Added for Opera
  215. ScLdAgainWin=ExpYes?ScLoc.document.body:ScLoc;
  216. ScLdAgainWin.onunload=UnLoaded;
  217. } //Added for Opera
  218. Trigger.onresize=Nav4?ReDoWhole:RePos;
  219. AfterBuild();
  220. if(MenuVerticalCentered=='static'&&!AcrssFrms)setInterval('KeepPos()',250);
  221. status='Menu ready for use'}
  222.  
  223. function KeepPos(){
  224. var TS=ExpYes?FrstLoc.document.body.scrollTop:FrstLoc.pageYOffset;
  225. if(TS!=StaticPos){
  226. var FCStyle=Nav4?FrstCntnr:FrstCntnr.style;
  227. FCStyle.top=FrstCntnr.OrgTop=StartTop+TS;StaticPos=TS}}
  228.  
  229. function ClcJus(){
  230. var a=BorderBtwnElmnts?1:2,b=BorderBtwnElmnts?BorderWidth:0;
  231. var Size=Math.round(((FrstWinWdth-a*BorderWidth)/NoOffFirstLineMenus)-b),i,j;
  232. for(i=1;i<NoOffFirstLineMenus+1;i++){j=eval('Menu'+i);j[5]=Size}
  233. StartLeft=0}
  234.  
  235. function ClcTrgt(){
  236. var TLoc=Nav4?FrstLoc.document.layers[TargetLoc]:DomYes?FrstLoc.document.getElementById(TargetLoc):FrstLoc.document.all[TargetLoc];
  237. StartTop=M_StrtTp;
  238. StartLeft=M_StrtLft;
  239. if(DomYes){
  240. while(TLoc){StartTop+=TLoc.offsetTop;StartLeft+=TLoc.offsetLeft;TLoc=TLoc.offsetParent}}
  241. else{ StartTop+=Nav4?TLoc.pageY:TLoc.offsetTop;StartLeft+=Nav4?TLoc.pageX:TLoc.offsetLeft}}
  242.  
  243. function ClcLft(){
  244. if(MenuCentered!='left'&&MenuCentered!='justify'){
  245. var Size=FrstWinWdth-(!Nav4?parseInt(FrstCntnr.style.width):FrstCntnr.clip.width);
  246. StartLeft=M_StrtLft;
  247. StartLeft+=MenuCentered=='right'?Size:Size/2}}
  248.  
  249. function ClcTp(){
  250. if(MenuVerticalCentered!='top'&&MenuVerticalCentered!='static'){
  251. var Size=FrstWinHght-(!Nav4?parseInt(FrstCntnr.style.height):FrstCntnr.clip.height);
  252. StartTop=M_StrtTp;
  253. StartTop+=MenuVerticalCentered=='bottom'?Size:Size/2}}
  254.  
  255. function PosMenu(CntnrPntr,Tp,Lt){
  256. var Topi,Lefti,Hori;
  257. var Cntnr=CntnrPntr;
  258. var Mmbr=Cntnr.FrstMbr;
  259. var CntnrStyle=!Nav4?Cntnr.style:Cntnr;
  260. var MmbrStyle=!Nav4?Mmbr.style:Mmbr;
  261. var PadL=Mmbr.value.indexOf('<')==-1?LftXtra:0;
  262. var PadT=Mmbr.value.indexOf('<')==-1?TpXtra:0;
  263. var MmbrWt=!Nav4?parseInt(MmbrStyle.width)+PadL:MmbrStyle.clip.width;
  264. var MmbrHt=!Nav4?parseInt(MmbrStyle.height)+PadT:MmbrStyle.clip.height;
  265. var CntnrWt=!Nav4?parseInt(CntnrStyle.width):CntnrStyle.clip.width;
  266. var CntnrHt=!Nav4?parseInt(CntnrStyle.height):CntnrStyle.clip.height;
  267. var SubTp,SubLt;
  268. RcrsLvl++;
  269. if (RcrsLvl==1 && AcrssFrms)!MenuFramesVertical?Tp=FrstWinHght-CntnrHt+(Nav4?4:0):Lt=RightToLeft?0:FrstWinWdth-CntnrWt+(Nav4?4:0);
  270. if (RcrsLvl==2 && AcrssFrms)!MenuFramesVertical?Tp=0:Lt=RightToLeft?ScWinWdth-CntnrWt:0;
  271. if (RcrsLvl==2 && AcrssFrms){Tp+=VerCorrect;Lt+=HorCorrect}
  272. CntnrStyle.top=RcrsLvl==1?Tp:0;
  273. Cntnr.OrgTop=Tp;
  274. CntnrStyle.left=RcrsLvl==1?Lt:0;
  275. Cntnr.OrgLeft=Lt;
  276. if (RcrsLvl==1 && FirstLineHorizontal){
  277. Hori=1;Lefti=CntnrWt-MmbrWt-2*BorderWidth;Topi=0}
  278. else{ Hori=Lefti=0;Topi=CntnrHt-MmbrHt-2*BorderWidth}
  279. while(Mmbr!=null){
  280. MmbrStyle.left=Lefti+BorderWidth;
  281. MmbrStyle.top=Topi+BorderWidth;
  282. if(Nav4)Mmbr.CmdLyr.moveTo(Lefti+BorderWidth,Topi+BorderWidth);
  283. if(Mmbr.ChildCntnr){
  284. if(RightToLeft)ChldCntnrWdth=Nav4?Mmbr.ChildCntnr.clip.width:parseInt(Mmbr.ChildCntnr.style.width);
  285. if(Hori){ SubTp=Topi+MmbrHt+2*BorderWidth;
  286. SubLt=RightToLeft?Lefti+MmbrWt-ChldCntnrWdth:Lefti}
  287. else{ SubLt=RightToLeft?Lefti-ChldCntnrWdth+ChildOverlap*MmbrWt+BorderWidth:Lefti+(1-ChildOverlap)*MmbrWt+BorderWidth;
  288. SubTp=RcrsLvl==1&&AcrssFrms?Topi:Topi+ChildVerticalOverlap*MmbrHt}
  289. PosMenu(Mmbr.ChildCntnr,SubTp,SubLt)}
  290. Mmbr=Mmbr.PrvMbr;
  291. if(Mmbr){ MmbrStyle=!Nav4?Mmbr.style:Mmbr;
  292. PadL=Mmbr.value.indexOf('<')==-1?LftXtra:0;
  293. PadT=Mmbr.value.indexOf('<')==-1?TpXtra:0;
  294. MmbrWt=!Nav4?parseInt(MmbrStyle.width)+PadL:MmbrStyle.clip.width;
  295. MmbrHt=!Nav4?parseInt(MmbrStyle.height)+PadT:MmbrStyle.clip.height;
  296. Hori?Lefti-=BorderBtwnElmnts?(MmbrWt+BorderWidth):(MmbrWt):Topi-=BorderBtwnElmnts?(MmbrHt+BorderWidth):(MmbrHt)}}
  297. RcrsLvl--}
  298.  
  299. function Initiate(){
  300. if(IniFlg){ Init(FrstCntnr);IniFlg=0;
  301. if(ShwFlg)AfterCloseAll();ShwFlg=0}}
  302.  
  303. function Init(CntnrPntr){
  304. var Mmbr=CntnrPntr.FrstMbr;
  305. var MCStyle=Nav4?CntnrPntr:CntnrPntr.style;
  306. RcrsLvl++;
  307. MCStyle.visibility=RcrsLvl==1?M_Show:M_Hide;
  308. while(Mmbr!=null){
  309. if(Mmbr.Hilite){Mmbr.Hilite=0;if(KeepHilite)LowItem(Mmbr)}
  310. if(Mmbr.ChildCntnr) Init(Mmbr.ChildCntnr);
  311. Mmbr=Mmbr.PrvMbr}
  312. RcrsLvl--}
  313.  
  314. function ClearAllChilds(Pntr){
  315. var CPCCStyle;
  316. while (Pntr){
  317. if(Pntr.Hilite){
  318. Pntr.Hilite=0;
  319. if(KeepHilite)LowItem(Pntr);
  320. if(Pntr.ChildCntnr){
  321. CPCCStyle=Nav4?Pntr.ChildCntnr:Pntr.ChildCntnr.style;
  322. CPCCStyle.visibility=M_Hide;
  323. ClearAllChilds(Pntr.ChildCntnr.FrstMbr)}
  324. break}
  325. Pntr=Pntr.PrvMbr}}
  326.  
  327. function GoTo(){
  328. if(this.LinkTxt){
  329. status='';
  330. var HP=Nav4?this.LowLyr:this;
  331. LowItem(HP);
  332. this.LinkTxt.indexOf('javascript:')!=-1?eval(this.LinkTxt):DcLoc.location.href=this.LinkTxt}}
  333.  
  334. function HiliteItem(P){
  335. if(Nav4){
  336. if(P.ro)P.document.images[P.rid].src=P.ri2;
  337. else{ if(P.HiBck)P.bgColor=P.HiBck;
  338. if(P.value.indexOf('<img')==-1){
  339. P.document.write(P.Ovalue);
  340. P.document.close()}}}
  341. else{ if(P.ro){ var Lc=P.Level==1?FrstLoc:ScLoc;
  342. Lc.document.images[P.rid].src=P.ri2}
  343. else{ if(P.HiBck)P.style.backgroundColor=P.HiBck;
  344. if(P.HiFntClr)P.style.color=P.HiFntClr}}
  345. P.Hilite=1}
  346.  
  347. function LowItem(P){
  348. if(P.ro){ if(Nav4)P.document.images[P.rid].src=P.ri1;
  349. else{ var Lc=P.Level==1?FrstLoc:ScLoc;
  350. Lc.document.images[P.rid].src=P.ri1}}
  351. else{ if(Nav4){ if(P.LoBck)P.bgColor=P.LoBck;
  352. if(P.value.indexOf('<img')==-1){
  353. P.document.write(P.value);
  354. P.document.close()}}
  355. else{ if(P.LoBck)P.style.backgroundColor=P.LoBck;
  356. if(P.LwFntClr)P.style.color=P.LwFntClr}}}
  357.  
  358. function OpenMenu(){
  359. if(!Loadd||!Creatd) return;
  360. var TpScrlld=ExpYes?ScLoc.document.body.scrollTop:ScLoc.pageYOffset;
  361. var LScrlld=ExpYes?ScLoc.document.body.scrollLeft:ScLoc.pageXOffset;
  362. var CCnt=Nav4?this.LowLyr.ChildCntnr:this.ChildCntnr;
  363. var ThisHt=Nav4?this.clip.height:parseInt(this.style.height);
  364. var ThisWt=Nav4?this.clip.width:parseInt(this.style.width);
  365. var ThisLft=AcrssFrms&&this.Level==1&&!FirstLineHorizontal?0:Nav4?this.Container.left:parseInt(this.Container.style.left);
  366. var ThisTp=AcrssFrms&&this.Level==1&&FirstLineHorizontal?0:Nav4?this.Container.top:parseInt(this.Container.style.top);
  367. var HP=Nav4?this.LowLyr:this;
  368. CurrntOvr=this;
  369. IniFlg=0;
  370. ClearAllChilds(this.Container.FrstMbr);
  371. HiliteItem(HP);
  372. if(CCnt!=null){
  373. if(!ShwFlg){ShwFlg=1; BeforeFirstOpen()}
  374. var CCW=Nav4?this.LowLyr.ChildCntnr.clip.width:parseInt(this.ChildCntnr.style.width);
  375. var CCH=Nav4?this.LowLyr.ChildCntnr.clip.height:parseInt(this.ChildCntnr.style.height);
  376. var ChCntTL=Nav4?this.LowLyr.ChildCntnr:this.ChildCntnr.style;
  377. var SubLt=AcrssFrms&&this.Level==1?CCnt.OrgLeft+ThisLft+LScrlld:CCnt.OrgLeft+ThisLft;
  378. var SubTp=AcrssFrms&&this.Level==1?CCnt.OrgTop+ThisTp+TpScrlld:CCnt.OrgTop+ThisTp;
  379. if(MenuWrap){
  380. if(RightToLeft){
  381. if(SubLt<LScrlld)SubLt=this.Level==1?LScrlld:SubLt+(CCW+(1-2*ChildOverlap)*ThisWt);
  382. if(SubLt+CCW> ScWinWdth+LScrlld)SubLt=ScWinWdth+LScrlld-CCW}
  383. else{ if(SubLt+CCW>ScWinWdth+LScrlld)SubLt=this.Level==1?ScWinWdth+LScrlld-CCW:SubLt-(CCW+(1-2*ChildOverlap)*ThisWt);
  384. if(SubLt<LScrlld)SubLt=LScrlld}
  385. if(SubTp+CCH> TpScrlld+ScWinHght)SubTp=this.Level==1?SubTp=TpScrlld+ScWinHght-CCH:SubTp-CCH+(1-2*ChildVerticalOverlap)*ThisHt;
  386. if(SubTp<TpScrlld)SubTp=TpScrlld}
  387. ChCntTL.top=SubTp;ChCntTL.left=SubLt;ChCntTL.visibility=M_Show}
  388. status=this.LinkTxt}
  389.  
  390. function OpenMenuClick(){
  391. if(!Loadd||!Creatd) return;
  392. var HP=Nav4?this.LowLyr:this;
  393. CurrntOvr=this;
  394. IniFlg=0;
  395. ClearAllChilds(this.Container.FrstMbr);
  396. HiliteItem(HP);
  397. status=this.LinkTxt}
  398.  
  399. function CloseMenu(){
  400. if(!Loadd||!Creatd) return;
  401. if(!KeepHilite){
  402. var HP=Nav4?this.LowLyr:this;
  403. LowItem(HP)}
  404. status='';
  405. if(this==CurrntOvr){
  406. IniFlg=1;
  407. if(CloseTmr)clearTimeout(CloseTmr);
  408. CloseTmr=setTimeout('Initiate(CurrntOvr)',DissapearDelay)}}
  409.  
  410. function CntnrSetUp(Wdth,Hght,NoOff){
  411. var x=RcrsLvl==1?BorderColor:BorderSubColor;
  412. this.FrstMbr=null;
  413. this.OrgLeft=this.OrgTop=0;
  414. if(x)this.bgColor=x;
  415. if(Nav4){ this.visibility='hide';
  416. this.resizeTo(Wdth,Hght)}
  417. else{ if(x)this.style.backgroundColor=x;
  418. this.style.width=Wdth;
  419. this.style.height=Hght;
  420. this.style.fontFamily=FontFamily;
  421. this.style.fontWeight=FontBold?'bold':'normal';
  422. this.style.fontStyle=FontItalic?'italic':'normal';
  423. this.style.fontSize=FontSize+'pt';
  424. this.style.zIndex=RcrsLvl+Ztop}}
  425.  
  426. function MbrSetUp(MmbrCntnr,PrMmbr,WhatMenu,Wdth,Hght){
  427. var Location=RcrsLvl==1?FrstLoc:ScLoc;
  428. var MemVal=eval(WhatMenu+'[0]');
  429. var t,T,L,W,H,S;
  430. var a,b,c,d;
  431. this.PrvMbr=PrMmbr;
  432. this.Level=RcrsLvl;
  433. this.LinkTxt=eval(WhatMenu+'[1]');
  434. this.Container=MmbrCntnr;
  435. this.ChildCntnr=null;
  436. this.Hilite=0;
  437. this.style.overflow='hidden';
  438. this.style.cursor=ExpYes&&(this.LinkTxt||(RcrsLvl==1&&UnfoldsOnClick))?'hand':'default';
  439. this.ro=0;
  440. if(MemVal.indexOf('rollover')!=-1){
  441. this.ro=1;
  442. this.ri1=MemVal.substring(MemVal.indexOf(':')+1,MemVal.lastIndexOf(':'));
  443. this.ri2=MemVal.substring(MemVal.lastIndexOf(':')+1,MemVal.length);
  444. this.rid=WhatMenu+'i';MemVal="<img src='"+this.ri1+"' name='"+this.rid+"'>"}
  445. this.value=MemVal;
  446. if(RcrsLvl==1){
  447. a=LowBgColor;
  448. b=HighBgColor;
  449. c=FontLowColor;
  450. d=FontHighColor}
  451. else{ a=LowSubBgColor;
  452. b=HighSubBgColor;
  453. c=FontSubLowColor;
  454. d=FontSubHighColor}
  455. this.LoBck=a;
  456. this.LwFntClr=c;
  457. this.HiBck=b;
  458. this.HiFntClr=d;
  459. this.style.color=this.LwFntClr;
  460. if(this.LoBck)this.style.backgroundColor=this.LoBck;
  461. this.style.textAlign=MenuTextCentered;
  462. if(eval(WhatMenu+'[2]'))this.style.backgroundImage="url(\'"+eval(WhatMenu+'[2]')+"\')";
  463. if(MemVal.indexOf('<')==-1){
  464. this.style.width=Wdth-LftXtra;
  465. this.style.height=Hght-TpXtra;
  466. this.style.paddingLeft=LeftPaddng;
  467. this.style.paddingTop=TopPaddng}
  468. else{ this.style.width=Wdth;
  469. this.style.height=Hght}
  470. if(MemVal.indexOf('<')==-1&&DomYes){
  471. t=Location.document.createTextNode(MemVal);
  472. this.appendChild(t)}
  473. else this.innerHTML=MemVal;
  474. if(eval(WhatMenu+'[3]')&&ShowArrow){
  475. a=RcrsLvl==1&&FirstLineHorizontal?3:RightToLeft?6:0;
  476. S=Arrws[a];
  477. W=Arrws[a+1];
  478. H=Arrws[a+2];
  479. T=RcrsLvl==1&&FirstLineHorizontal?Hght-H-2:(Hght-H)/2;
  480. L=RightToLeft?2:Wdth-W-2;
  481. if(DomYes){
  482.  
  483. t=Location.document.createElement('img');
  484. this.appendChild(t);
  485. t.style.position='absolute';
  486. t.src=S;
  487.  
  488. t.style.width=W;
  489. t.style.height=H;
  490. t.style.top=T;
  491. t.style.left=L}
  492. else{ MemVal+="<div style='position:absolute; top:"+T+"; left:"+L+"; width:"+W+"; height:"+H+";visibility:inherit'> <img src='"+S+"'> </div> ";
  493. this.innerHTML=MemVal}}
  494. if(ExpYes){this.onselectstart=CnclSlct;
  495. this.onmouseover=RcrsLvl==1&&UnfoldsOnClick?OpenMenuClick:OpenMenu;
  496. this.onmouseout=CloseMenu;
  497. this.onclick=RcrsLvl==1&&UnfoldsOnClick&&eval(WhatMenu+'[3]')?OpenMenu:GoTo }
  498. else{ RcrsLvl==1&&UnfoldsOnClick?this.addEventListener('mouseover',OpenMenuClick,false):this.addEventListener('mouseover',OpenMenu,false);
  499. this.addEventListener('mouseout',CloseMenu,false);
  500. RcrsLvl==1&&UnfoldsOnClick&&eval(WhatMenu+'[3]')?this.addEventListener('click',OpenMenu,false):this.addEventListener('click',GoTo,false)}}
  501.  
  502. function NavMbrSetUp(MmbrCntnr,PrMmbr,WhatMenu,Wdth,Hght){
  503. var a,b,c,d;
  504. if(RcrsLvl==1){
  505. a=LowBgColor;
  506. b=HighBgColor;
  507. c=FontLowColor;
  508. d=FontHighColor}
  509. else { a=LowSubBgColor;
  510. b=HighSubBgColor;
  511. c=FontSubLowColor;
  512. d=FontSubHighColor }
  513. this.value=eval(WhatMenu+'[0]');
  514. this.ro=0;
  515. if(this.value.indexOf('rollover')!=-1){
  516. this.ro=1;
  517. this.ri1=this.value.substring(this.value.indexOf(':')+1,this.value.lastIndexOf(':'));
  518. this.ri2=this.value.substring(this.value.lastIndexOf(':')+1,this.value.length);
  519. this.rid=WhatMenu+'i';this.value="<img src='"+this.ri1+"' name='"+this.rid+"'> "}
  520. if(LeftPaddng&&this.value.indexOf('<')==-1&&MenuTextCentered=='left')this.value='&nbsp\;'+this.value;
  521. if(FontBold)this.value=this.value.bold();
  522. if(FontItalic)this.value=this.value.italics();
  523. this.Ovalue=this.value;
  524. this.value=this.value.fontcolor(c);
  525. this.Ovalue=this.Ovalue.fontcolor(d);
  526. this.value=CntrTxt+"<font face='"+FontFamily+"' point-size='"+FontSize+"'> "+this.value+TxtClose;
  527. this.Ovalue=CntrTxt+"<font face='"+FontFamily+"' point-size='"+FontSize+"'> "+this.Ovalue+TxtClose;
  528. this.LoBck=a;
  529. this.HiBck=b;
  530. this.ChildCntnr=null;
  531. this.PrvMbr=PrMmbr;
  532. this.Hilite=0;
  533. this.visibility='inherit';
  534. if(this.LoBck)this.bgColor=this.LoBck;
  535. this.resizeTo(Wdth,Hght);
  536. if(!AcrssFrms&&eval(WhatMenu+'[2]'))this.background.src=eval(WhatMenu+'[2]');
  537. this.document.write(this.value);
  538. this.document.close();
  539. this.CmdLyr=new Layer(Wdth,MmbrCntnr);
  540. this.CmdLyr.Level=RcrsLvl;
  541. this.CmdLyr.LinkTxt=eval(WhatMenu+'[1]');
  542. this.CmdLyr.visibility='inherit';
  543. this.CmdLyr.onmouseover=RcrsLvl==1&&UnfoldsOnClick?OpenMenuClick:OpenMenu;
  544. this.CmdLyr.onmouseout=CloseMenu;
  545. this.CmdLyr.captureEvents(Event.MOUSEUP);
  546. this.CmdLyr.onmouseup=RcrsLvl==1&&UnfoldsOnClick&&eval(WhatMenu+'[3]')?OpenMenu:GoTo;
  547. this.CmdLyr.LowLyr=this;
  548. this.CmdLyr.resizeTo(Wdth,Hght);
  549. this.CmdLyr.Container=MmbrCntnr;
  550. if(eval(WhatMenu+'[3]')&&ShowArrow){
  551. a=RcrsLvl==1&&FirstLineHorizontal?3:RightToLeft?6:0;
  552. this.CmdLyr.ImgLyr=new Layer(Arrws[a+1],this.CmdLyr);
  553. this.CmdLyr.ImgLyr.visibility='inherit';
  554. this.CmdLyr.ImgLyr.top=RcrsLvl==1&&FirstLineHorizontal?Hght-Arrws[a+2]-2:(Hght-Arrws[a+2])/2;
  555. this.CmdLyr.ImgLyr.left=RightToLeft?2:Wdth-Arrws[a+1]-2;
  556. this.CmdLyr.ImgLyr.width=Arrws[a+1];
  557. this.CmdLyr.ImgLyr.height=Arrws[a+2];
  558. ImgStr="<img src='"+Arrws[a]+"' width='"+Arrws[a+1]+"' height='"+Arrws[a+2]+"'> ";
  559. this.CmdLyr.ImgLyr.document.write(ImgStr);
  560. this.CmdLyr.ImgLyr.document.close()}}
  561.  
  562. function CreateMenuStructure(MName,NumberOf){
  563. RcrsLvl++;
  564. var i,NoOffSubs,Mbr,Wdth=0,Hght=0;
  565. var PrvMmbr=null;
  566. var WMnu=MName+'1';
  567. var MenuWidth=eval(WMnu+'[5]');
  568. var MenuHeight=eval(WMnu+'[4]');
  569. var Location=RcrsLvl==1?FrstLoc:ScLoc;
  570. if (RcrsLvl==1&&FirstLineHorizontal){
  571. for(i=1;i<NumberOf+1;i++){
  572. WMnu=MName+eval(i);
  573. Wdth=eval(WMnu+'[5]')?Wdth+eval(WMnu+'[5]'):Wdth+MenuWidth}
  574. Wdth=BorderBtwnElmnts?Wdth+(NumberOf+1)*BorderWidth:Wdth+2*BorderWidth;Hght=MenuHeight+2*BorderWidth}
  575. else{ for(i=1;i<NumberOf+1;i++){
  576. WMnu=MName+eval(i);
  577. Hght=eval(WMnu+'[4]')?Hght+eval(WMnu+'[4]'):Hght+MenuHeight}
  578. Hght=BorderBtwnElmnts?Hght+(NumberOf+1)*BorderWidth:Hght+2*BorderWidth;Wdth=MenuWidth+2*BorderWidth}
  579. if(DomYes){
  580. var MmbrCntnr=Location.document.createElement("div");
  581. MmbrCntnr.style.position='absolute';
  582. MmbrCntnr.style.visibility='hidden';
  583. Location.document.body.appendChild(MmbrCntnr)}
  584. else{ if(Nav4) var MmbrCntnr=new Layer(Wdth,Location)
  585. else{ WMnu+='c';
  586. Location.document.body.insertAdjacentHTML("AfterBegin","<div id='"+WMnu+"' style='visibility:hidden; position:absolute;'> <\/div> ");
  587. var MmbrCntnr=Location.document.all[WMnu]}}
  588. MmbrCntnr.SetUp=CntnrSetUp;
  589. MmbrCntnr.SetUp(Wdth,Hght,NumberOf);
  590. if(Exp4){ MmbrCntnr.InnerString='';
  591. for(i=1;i<NumberOf+1;i++){
  592. WMnu=MName+eval(i);
  593. MmbrCntnr.InnerString+="<div id='"+WMnu+"' style='position:absolute;'> <\/div> "}
  594. MmbrCntnr.innerHTML=MmbrCntnr.InnerString}
  595. for(i=1;i<NumberOf+1;i++){
  596. WMnu=MName+eval(i);
  597. NoOffSubs=eval(WMnu+'[3]');
  598. Wdth=RcrsLvl==1&&FirstLineHorizontal?eval(WMnu+'[5]')?eval(WMnu+'[5]'):MenuWidth:MenuWidth;
  599. Hght=RcrsLvl==1&&FirstLineHorizontal?MenuHeight:eval(WMnu+'[4]')?eval(WMnu+'[4]'):MenuHeight;
  600. if(DomYes){
  601. Mbr=Location.document.createElement("div");
  602. Mbr.style.position='absolute';
  603. Mbr.style.visibility='inherit';
  604. MmbrCntnr.appendChild(Mbr)}
  605. else Mbr=Nav4?new Layer(Wdth,MmbrCntnr):Location.document.all[WMnu];
  606. Mbr.SetUp=Nav4?NavMbrSetUp:MbrSetUp;
  607. Mbr.SetUp(MmbrCntnr,PrvMmbr,WMnu,Wdth,Hght);
  608. if(NoOffSubs) Mbr.ChildCntnr=CreateMenuStructure(WMnu+'_',NoOffSubs);
  609. PrvMmbr=Mbr}
  610. MmbrCntnr.FrstMbr=Mbr;
  611. RcrsLvl--;
  612. return(MmbrCntnr)}
  613.  
  614. function CreateMenuStructureAgain(MName,NumberOf){
  615. var i,WMnu,NoOffSubs,PrvMmbr,Mbr=FrstCntnr.FrstMbr;
  616. RcrsLvl++;
  617. for(i=NumberOf;i> 0;i--){
  618. WMnu=MName+eval(i);
  619. NoOffSubs=eval(WMnu+'[3]');
  620. PrvMmbr=Mbr;
  621. if(NoOffSubs)Mbr.ChildCntnr=CreateMenuStructure(WMnu+'_',NoOffSubs);
  622. Mbr=Mbr.PrvMbr}
  623. RcrsLvl--}
  624.  
  625. function BeforeStart(){return}
  626. function AfterBuild(){return}
  627. function BeforeFirstOpen(){return}
  628. function AfterCloseAll(){return}
  629.  
  630. </script>
  631. <noscript> Your browser does not support script</noscript>
  632.  
  633. <!-- REST OF BODY CONTENT BELOW HERE -->
  634.  
  635. <script language="JavaScript1.2">
  636.  
  637. /*
  638. Cross browser Marquee script- © Dynamic Drive ([url]www.dynamicdrive.com[/url])
  639. For full source code, 100's more DHTML scripts, and Terms Of Use, visit [url]http://www.dynamicdrive.com[/url]
  640. Credit MUST stay intact
  641. */
  642.  
  643. //Specify the marquee's width (in pixels)
  644. var marqueewidth="300px"
  645. //Specify the marquee's height
  646. var marqueeheight="25px"
  647. //Specify the marquee's marquee speed (larger is faster 1-10)
  648. var marqueespeed=2
  649. //configure background color:
  650. var marqueebgcolor="#DEFDD9"
  651. //Pause marquee onMousever (0=no. 1=yes)?
  652. var pauseit=1
  653.  
  654. //Specify the marquee's content (don't delete <nobr> tag)
  655. //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
  656.  
  657. var marqueecontent='<nobr> <font face="Arial"> Thank you for visiting <a href="http://www.dynamicdrive.com"> Dynamic Drive.</a> If you find this script useful, please consider linking to us by <a href="../link.htm"> click here.</a> Enjoy your stay!</font> </nobr> '
  658.  
  659.  
  660. ////NO NEED TO EDIT BELOW THIS LINE////////////
  661. marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
  662. var copyspeed=marqueespeed
  663. var pausespeed=(pauseit==0)? copyspeed: 0
  664. var iedom=document.all||document.getElementById
  665. if (iedom)
  666. document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px"> '+marqueecontent+'</span> ')
  667. var actualwidth=''
  668. var cross_marquee, ns_marquee
  669.  
  670. function populate(){
  671. if (iedom){
  672. cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
  673. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  674. cross_marquee.innerHTML=marqueecontent
  675. actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
  676. }
  677. else if (document.layers){
  678. ns_marquee=document.ns_marquee.document.ns_marquee2
  679. ns_marquee.left=parseInt(marqueewidth)+8
  680. ns_marquee.document.write(marqueecontent)
  681. ns_marquee.document.close()
  682. actualwidth=ns_marquee.document.width
  683. }
  684. lefttime=setInterval("scrollmarquee()",20)
  685. }
  686. window.onload=populate
  687.  
  688. function scrollmarquee(){
  689. if (iedom){
  690. if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
  691. cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
  692. else
  693. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  694.  
  695. }
  696. else if (document.layers){
  697. if (ns_marquee.left>(actualwidth*(-1)+8))
  698. ns_marquee.left-=copyspeed
  699. else
  700. ns_marquee.left=parseInt(marqueewidth)+8
  701. }
  702. }
  703.  
  704. if (iedom||document.layers){
  705. with (document){
  706. document.write('<table border="0" cellspacing="0" cellpadding="0"> <td> ')
  707. if (iedom){
  708. write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden"> ')
  709. write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"> ')
  710. write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"> </div> ')
  711. write('</div> </div> ')
  712. }
  713. else if (document.layers){
  714. write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'> ')
  715. write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"> </layer> ')
  716. write('</ilayer> ')
  717. }
  718. document.write('</td> </table> ')
  719. }
  720. }
  721. </script>
  722. </body>
  723. </html>
Last edited by peter_budo; Dec 30th, 2008 at 8:48 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gbogze is offline Offline
3 posts
since Dec 2008
Dec 30th, 2008
2

Re: java

*gulp*

That's a load.

Can you post a link to the tutorial or site where the javascript effects are from. There might be a FAQ there on integrating 2 scripts. I want to check it out. =)

*I made a local copy of your code and I'm currently 'breaking it'.

UPDATE:
Apparently, the menu script isn't working even if the marquee script is removed... the menu script seems to be broken. Can you provide the code of the last working 'copy' of the menu script?
Last edited by kanaku; Dec 30th, 2008 at 8:40 am. Reason: added update
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Jan 1st, 2009
0

Re: java

Ok. There's a problem with the way you position your marquee... the marquee is covering the menu.

Try adding a holder to your marquee and styling it with CSS so it moves away from your menu. I highlighted the changes in red.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
#marquee-div
{
float: right;
}
-->
</style>
</head>

<body>

.... here add the script for your menu ....



<div id="marquee-div">

... here add the script for your marquee ...

</div>
</body>
</html>

What I did was float the marquee div to the right. Just so you can see both of your scripts. Of course, it's up to you where you'll place the elements.
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Chat Application
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: is it possible to save result like this example





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC