PDA

View Full Version : Right script..wrong place?



itpro15
11-16-2005, 10:51 PM
Hello Everyone,

I have a script that I'm using Mike's DHTML scroller in my page from:
http://www.dynamicdrive.com/dynamicindex2/mikescroll.htm

and it works great BUT not in the right spot in my page. It always shows in the top of bottom, never in the middle? My code is in the link below, any ideas because I've run out of my own.

http://www.kandbcoffeesbean.com/Varietals.html

Thank you in advance!!!!

jscheuer1
11-17-2005, 06:47 AM
First off it is a wonder the script works at all. It doesn't in FF, and it is supposed to. Anyways, you have two body tags on your page. A big no no. You also have two separate onload events, another no no. To fix these, change the first body tag, that now looks like so:


</HEAD>
<body>
<div id="tempholder"></div>

to this:


</head>
<body bgcolor="black" onload="CSScriptInit();runmikescroll();">
<div id="tempholder"></div>

Remove this line from Mike's DHTML scroller script (the part on the page, thankfully):


window.onload=runmikescroll

And remove this other body and associated erroneous tags completely:


</body>
</html>


<BODY BGCOLOR=BLACK ONLOAD="CSScriptInit();">

Now we are ready to go to work on your question. Find this line (it is just above where that last bit we removed was, and just after the script):


<div id="placeholder" style="position:relative; width:420px; height:32px;"> </div>

Change it to this:


<center><div id="placeholder" style="position:relative; width:420px; height:32px;top:30px;"> </div></center>

Notice the top:30px; part I added, that gets the scroller into a better position vertically, I think. The higher this number, the lower down the page the scroller will appear.

itpro15
11-18-2005, 12:39 AM
John,

Thank you for taking the time to answer my question, I really appreciate it! It worked great! Keep up the great work, novices like myself really appreciate the extra time to kinda explain where they went wrong.

Many Thanks John!!

Brian