diff --git a/include/lib/select_box.class.php b/include/lib/select_box.class.php index 6a6689840..430e28b7f 100644 --- a/include/lib/select_box.class.php +++ b/include/lib/select_box.class.php @@ -46,17 +46,28 @@ class Select_Box function input() { + // Show when click $javascript=sprintf('$("%s_bt").onclick=function() { try { var newDiv=$("select_box%s"); - var pos=$("%s_bt").cumulativeOffset(); - newDiv.setStyle({display:"block",position:"absolute",top:pos.top+25+"px",left:pos.left+5+"px"}); + var pos=$("%s_bt").cumulativeOffset(); + newDiv.setStyle({display:"block",position:"fixed",top:pos.top+25+"px",left:pos.left+5+"px"}); } catch(e) { alert(e.message); } -} -', $this->id, $this->id, $this->id, $this->id); + } + ', $this->id, $this->id, $this->id, $this->id); + + // Hide when out of the zone + $javascript.=sprintf('$("select_box%s").onmouseleave=function() { + try { + var newDiv=$("select_box%s"); + newDiv.setStyle({display:"none"}); + } catch(e) { + alert(e.message); + } + }',$this->id,$this->id); // display the button printf('', @@ -68,7 +79,7 @@ class Select_Box // Print the list of possible options - echo "