SirChick Posted October 10, 2007 Share Posted October 10, 2007 I have attatched a picture to show you what is showing on my page. As you can see from the horizontal scroll bar... i can scroll for miles accross... nothing is visible but if i highlight all as shown in the picture there is an invisible line going across.... ive not seen it before but i know what code is creating but i do not know why or what part of the script is causing it.. has any one see it before? Any way this is the script causing it..the script does work without errors and it does what its meant to except for this strange invisible line: <? include ("include.php"); $Level = $row["Level"]; $Money = $row["MoneyInHand"]; $Donator = $row["Donator"]; $Networth = $row["networth"]; //set max energy If ($Donator = 1) { $row["MaxEnergy"] = 250; }Else{ $row["MaxEnergy"] = 100; } //setting max courage $EXP = $row["CrimeExp"]; ?> <div id='bv_' style='position:absolute;left:30px;top:118px;width:200px;height:19px;z-index:12' align='center'> <font style='font-size:14px' color='#FFFFFF' face='Arial'><b>Level:<font color='#32CD32'> <?= $Level?></b></font></div> <div id='bv_' style='position:absolute;left:145px;top:118px;width:200px;height:19px;z-index:12' align='center'> <font style='font-size:14px' color='#FFFFFF' face='Arial'><b>Money: <font color='#32CD32'>£<?= $Money?></b></font></div> <img src="energymax.jpg" id="Image2" alt="" align="top" border="0" width="125" height="5" style="position:absolute;left:380px;top:130px;z-index:1"> <? //Energy Bar for user $MaxEnergy = $row["MaxEnergy"]; $CurrentEnergy = $row["CurrentEnergy"]; $height = 5; $width = 125; $NewCurrentEnergy = ($CurrentEnergy / $MaxEnergy) * $width; echo "<div id='bv_' style='position:absolute;left:340px;top:115px;width:200px;height:19px;z-index:12' align='center'>"; echo "<font style='font-size:12px' color='#FFFFFF' face='Arial'><b>Energy $CurrentEnergy/$MaxEnergy</b></font></div>"; echo "<img src='energycurrent.jpg' id='Image2' alt='' align='top' border='0' width='.$NewCurrentEnergy.'height='5' style='position:absolute;left:380px;top:130px;z-index:1'>"; ?> <img src="couragemax.jpg" id="Image2" alt="" align="top" border="0" width="125" height="5" style="position:absolute;left:580px;top:130px;z-index:1"> <? //courage bar for user $MaxCourage = $row["MaxCourage"]; $CurrentCourage = $row["CurrentCourage"]; $height = 5; $width = 125; $NewCurrentCourage = ($CurrentCourage / $MaxCourage) * $width; echo "<div id='bv_' style='position:absolute;left:543px;top:115px;width:200px;height:19px;z-index:12' align='center'>"; echo "<font style='font-size:12px' color='#FFFFFF' face='Arial'><b>Courage $CurrentCourage/$MaxCourage</b></font></div>"; echo "<img src='currentcourage.jpg' id='Image2' alt='' align='top' border='0' width='.$NewCurrentCourage.'height='5' style='position:absolute;left:580px;top:130px;z-index:1'>"; ?> <img src="maxhappy.jpg" id="Image2" alt="" align="top" border="0" width="125" height="5" style="position:absolute;left:780px;top:130px;z-index:1"> <? //happy bar for user $HouseType = $houserow["HouseType"]; $MaxHappy = $row["MaxHappy"]; $CurrentHappy = $row["CurrentHappy"]; $height = 5; $width = 125; $NewCurrentHappy = ($CurrentHappy / $MaxHappy) * $width; echo "<div id='bv_' style='position:absolute;left:740px;top:115px;width:200px;height:19px;z-index:12' align='center'>"; echo "<font style='font-size:12px' color='#FFFFFF' face='Arial'><b>Happy $CurrentHappy/$MaxHappy</b></font></div>"; echo "<img src='currenthappy.jpg' id='Image2' alt='' align='top' border='0' width='.$NewCurrentHappy.'height='5' style='position:absolute;left:780px;top:130px;z-index:1'>"; ?> [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
d22552000 Posted October 10, 2007 Share Posted October 10, 2007 imgussing that bar is either courage or exp/hp? in any case the only immediate error I see is: "id='bv_''" in HTML every ID must be UNIQUE. this will not show anyerrors, but may cause freak errors liek this. Quote Link to comment Share on other sites More sharing options...
SirChick Posted October 10, 2007 Author Share Posted October 10, 2007 I have fine tuned the code. Its only these 3 lines causing it: echo "<div id='bv3' style='position:absolute;left:340px;top:115px;width:150px;height:19px;z-index:12' align='center'>"; echo "<font style='font-size:12px' color='#FFFFFF' face='Arial'><b>Energy $CurrentEnergy/$MaxEnergy</b></font></div>"; echo "<img src='energycurrent.jpg' id='Image2' alt='' align='top' border='0' width='.$NewCurrentEnergy.'height='5' style='position:absolute;left:380px;top:130px;z-index:1'>"; Quote Link to comment Share on other sites More sharing options...
d22552000 Posted October 10, 2007 Share Posted October 10, 2007 try echoing $NEWCURRENTENERGY and see what its value is, cause that may be the unusually high value, I notice is is being multiplied by width... ?? $NewCurrentEnergy = ($CurrentEnergy / $MaxEnergy) * $width; Maybe try...? $NewCurrentEnergy = ($CurrentEnergy / $MaxEnergy) % $width; use % says "MAX" in mathml I believe... This might make the bar too smal though, tell me what it does Quote Link to comment Share on other sites More sharing options...
SirChick Posted October 10, 2007 Author Share Posted October 10, 2007 yeah energy is pretty high... the image was meant to remain a fixed size but only load across the % that the current has from the max... which im assuming is what : $NewCurrentEnergy = ($CurrentEnergy / $MaxEnergy) % $width; does? Quote Link to comment Share on other sites More sharing options...
d22552000 Posted October 10, 2007 Share Posted October 10, 2007 % makes it so that $width is the MAX that the image can be. try it out and tell me if it works. Quote Link to comment Share on other sites More sharing options...
SirChick Posted October 10, 2007 Author Share Posted October 10, 2007 yeh i did but then if say you had: current E as 50 and max as 100 the bar shows that u max E rather than only half. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted October 10, 2007 Share Posted October 10, 2007 hmm the % should only LIMIT , not change the thing to always be 100 TRY THIS: turn $width from 125 to 1.25, then use the * script that you had. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.