2014-01-21 98 views
2

我的代碼可以在這裏找到:http://macrorevolution.com/calculators/tdee/HTML選擇框犯規強調最後一個選項

當我把我的鼠標在過去​​3210它並不突出,而不是的其餘選項。我嘗試添加更多選項,並且每次都是不突出顯示的最後一個選項。我怎樣才能解決這個問題?

<?php 
$answer = ""; 
$agev = ""; 
$feetv = ""; 
$inchesv = ""; 
$weightv = ""; 
$sex = ""; 
$activelevel = ""; 
if(isset($_POST['agev']) && isset($_POST['feetv']) && isset($_POST['inchesv']) && isset($_POST['weightv']) && isset($_POST['sex'])) { 
    //&& isset($_POST['activelevel']) 
    $agev = $_POST['agev']; 
    $feetv = $_POST['feetv']; 
    $inchesv = $_POST['inchesv']; 
    $weightv = $_POST['weightv']; 
    $sex = $_POST['sex']; 
    $activelevel = $_POST['activelevel']; 
    $totalheightv = $inchesv + ($feetv*12); 
    $heightcm = $totalheightv*2.54; 
    $weightkg = $weightv/2.2; 

    if($activelevel=='1v') $activelevel=1.2; 
    else if($activelevel=='2v') $activelevel=1.375; 
    else if($activelevel=='3v') $activelevel=1.55; 
    else if($activelevel=='4v') $activelevel=1.725; 
    else if($activelevel=='5v') $activelevel=1.9; 
    else echo "error"; 
    //echo $activelevel; 

    if($sex=='male') $answer = $activelevel * (66.47 + (13.75*$weightkg) + (5*$heightcm) - (6.75*$agev)); 
    if($sex=='female') $answer = $activelevel * (665.09 + (9.56*$weightkg) + (1.84*$heightcm) - (4.67*$agev)); 


} 
?> 


<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" > 
<title>Total Daily Energy Expenditure</title> 

<style type="text/css"> 
.bold { 
font-weight:bold; 
} 
    table { 
    font-size:14px; 
    font-family: 'PT Sans', sans-serif; 
    background-color:#FFFFFF; 
    } 
tr.spaceUnder > td 
{ 
    padding:0em 1em 1em 0em; 

} 
p.ss { 
    font-size:30px; 
    text-align:center 
} 
input { 
margin-right:5px; 
margin-left:5px; 
} 
.bp 
{ 
border: 1px solid #000000; 
text-align:center; 
} 


</style> 
</head> 
<body> 
<div class="box pt20"> 
<p class="ss">MacroRevolution TDEE Calculator</p><br> 
<table width='80%' style="margin: 0 auto;"> 
    <tr class="spaceUnder"> 
    <td colspan="4"> 
TDEE = Total Daily Energy Expenditure. TDEE is the amount calories your body burns in a 24 hour period which includes eating, sleeping, excercising, and working. 
    </td> 
    </tr> 
</table> 

<form method='post' action=''> 
<table width='80%' style="margin: 0 auto;"> 


    <tr class="spaceUnder"> 
     <td>Age:</td> 
     <td><input type='text' name='agev' value="<?php echo $agev; ?>"/>Years</td> 
    </tr> 
    <tr class="spaceUnder"> 
     <td>Height:</td> 
     <td align="justify"><input type='text' name='feetv' value="<?php echo $feetv; ?>"/>Ft 

     <input type='text' name='inchesv' value="<?php echo $inchesv; ?>"/>In</td> 
    </tr> 
    <tr class="spaceUnder"> 
     <td>Weight:</td> 
     <td align="left"><input type='text' name='weightv' value="<?php echo $weightv; ?>"/>lbs</td> 
    </tr> 
    <tr class="spaceUnder"> 
     <td colspan="2"><input type='radio' name='sex' value='male'>Male 
         <input type='radio' name='sex' value='female'>Female</td> 
    </tr> 
     <tr class="spaceUnder"> 
    <td colspan="2"> 
     <select name="activelevel"> 
    <option name='activelevel' value='1v'>Little or no Excercise/Desk job</option> 
    <option name='activelevel' value='2v'>Light exercise/Workout 1-3 days/week</option> 
    <option name='activelevel' value='3v'>Moderate exercise/Workout 3-5 days/week</option> 
    <option name='activelevel' value='4v'>Heavy exercise/Workout 6-7 days/week</option> 
    <option name='activelevel' value='5v'>Very heavy exercise/Physical job/Workout 2 times a day</option> 
     </select> 
     </td> 
     </tr> 

    <tr class="spaceUnder"> 
     <td colspan="2"><input type='submit' class="button highlight small" value='Calculate'/></td> 
    </tr> 
    <tr class="spaceUnder"> 
     <td colspan="2">Your TDEE is <input type='text' style="width: 50px; font-weight:bold;" value='<?php echo round($answer,0); ?>' /><strong>k/cal per day</strong> </td> 
    </tr> 

</table> 
</form> 


<table width='80%' style="margin: 0 auto;"> 
    <td colspan="4"> 


     TDEE = BMR x Activity Level <br> 
    Where the formula for BMR(Harris-Benedict formula) is <br><br> 
Men: BMR=66.47+ (13.75 x W) + (5.0 x H) - (6.75 x A) <br> 
Women: BMR=665.09 + (9.56 x W) + (1.84 x H) - (4.67 x A) <br><br> 

    W = Weight in kilograms (lbs/2.2)<br> 
    H = Height in centimeters (inches x 2.54)<br> 
    A = Age in years <br><br><br> 

     <table width='500px' style="border: 1px solid;" class="bp"> 
    <tr class="bp"> 
    <th class="bp">Amount of Activity</th> 
    <th class="bp">Description</th> 
    <th class="bp">TDEE Activity Level</th> 
    </tr> 
    <tr class="bp"> 
    <td class="bp">Sedentary</td> 
    <td class="bp">Little or no Excercise/Desk job</td> 
    <td class="bp">1.2</td> 
    </tr> 
    <tr class="bp"> 
    <td class="bp">Lightly Active</td> 
    <td class="bp">Light exercise/Workout 1-3 days/week</td> 
    <td class="bp">1.375</td> 
    </tr> 
    <tr class="bp"> 
    <td class="bp">Moderately Active</td> 
    <td class="bp">Moderate exercise/Workout 3-5 days/week</td> 
    <td class="bp">1.55</td> 
    </tr> 
    <tr class="bp"> 
    <td class="bp">Very Active</td> 
    <td class="bp">Heavy exercise/Workout 6-7 days/week</td> 
    <td class="bp">1.725</td> 
    </tr> 
    <tr class="bp"> 
    <td class="bp">Extremely Active</td> 
    <td class="bp">Very heavy exercise/Physical job/Workout 2 times a day</td> 
    <td class="bp">1.9</td> 
    </tr> 
    </table> 
    <br><br><br> 
     </tr> 
</table> 
</div> 

</body> 
</html> 
+0

Dunno,在Firefox中正常工作。 –

+0

我的鏈接上沒有任何問題... –

+0

適用於我的Chrome(版本32.0.1700.76米) – ITroubs

回答

2

更新This Chrome bug ticket,類似的bug票下面列出的只是該票是針對Chrome 32.0.1700.76


我假設你使用的是Chrome?

我的同事和我昨天在每個頁面上遇到了這個問題,我們有下拉菜單。

碰巧有一個chrome bug描述完全相同的問題。 bug ticket在票證的頭部陳述了一個不同版本的chrome,但是如果你閱讀他們註釋的註釋,它也會影響其他版本的Chrome。論壇上的帖子我看了碰巧是同我的瀏覽器/ OS(礦山的64位)

Google Chrome版本32.0.1700.76米 操作系統:Windows 7的

要驗證嘗試以下您的Chrome瀏覽器中的步驟(在bug ticket中找到的步驟)

什麼步驟會重現問題?

  1. 啓動並公開Chrome的「鉻://設置」
  2. 點擊任何一個下拉箭頭,打開下拉列表
  3. 鼠標懸停在所有下拉列表項和觀察

我不認爲這個問題是你的代碼,它是Chrome。所以目前沒有什麼可以做的。

一切都說,即使它不突出顯示,它應該仍然是可點擊的。

+1

我無法在Firefox中複製它,所以它可能是一個錯誤 – professorfish

相關問題