PDA

View Full Version : Javascript/HTML - Prompt reply required please...


Ace
06-15-04, 02:27 PM
I have a major headache with a website I'm making for someone and I'm running out of time. I essentially need to add a locked textbox with scrollbars. A frameset and frame with text in and scrollbars would do but I don't want to resort to that because of limited cross-browser support. I've found a prime example of what I want on another site but I don't want to copy code directly. It seems relatively simple but I'm no JS expert and I really could do with someone explaining this code to me... the example is <a target=new class=ftalternatingbarlinklarge href="http://www.onelifestyle.co.uk/?thefitmap">here</a> but to save you the trouble here's the code I'm looking at (taken from above site - these bits seem to be the relevant bits):<BR><BR><SCRIPT LANGUAGE="JavaScript1.2" src="load1.js"><BR></SCRIPT><BR></head><BR><script><BR>document.writeln("<style>"); <b><u>*</b></u><BR><BR>document.writeln("#textlayer {scrollbar-base-color: #ffffff; scrollbar-face-color: #ffffff; scrollbar-track-color: #C6E3D0; scrollbar-arrow-color: #C6E3D0; scrollbar-highlight-color: #CCCCCC; scrollbar-3dlight-color: #000000; scrollbar-shadow-color: #CCCCCC; scrollbar-darkshadow-color: #CCCCCC; background-repeat: no-repeat; position:absolute; width:380px; height:224px; z-index:1; left: 390px; top: 93px; overflow: auto}");<BR><BR><div id="textlayer"><font face="Arial, Helvetica, sans-serif" size="2" color="#767676"><BR>Text here... blah blah... etc.<BR><BR>I basically understand the stuff after the <b><u>*</b></u>. What I don't get is: <BR><BR>what's load1.js? Do I have to have this file with the webpage? Is it client based? What would the client require to view it?<BR><BR>the second script tag doesn't state a script. Is it loading the load1.js thing? <BR><BR>how come HTML is popping up in the brackets and why? What does that mean? No close </style> tag?<BR><BR>what does document.writeln do?<BR><BR>If you can shed any light on this thanks... if not thanks for reading this far lol.