javascript - jquery ui autocomplete positioning wrong -


using jquery ui 1.8 trying autocomplete

everything works apart ui-menu isn't positioned under input element, rather in top left corner.

has come across problem?

here's html:

<div id="search">     <div id="searchformwrapper">         <form method="post" name="searchform" id="searchform" action="/searchresults">         <label for="searchphrase" id="searchfor">             search for</label>         <input name="searchphrase" id="searchphrase" type="text" />         <label for="searchscope" id="searchin">             in</label>         <select name="searchscope" id="searchscope">             <option value="">all shops</option>             ...         </select>         <input type="image" name="submitsearch" id="submitsearch" src="/images/buttons/search.gif"             alt="search ..." />         </form>         <br class="clear" />     </div> </div> 

and here's css:

#search {  width:100%;  margin:0;  padding:0;  text-align:center;  height:36px;  line-height:36px;  background:#666 url(/images/interface/info_bar_bg.gif) repeat-x top left;  overflow:hidden;  font-size:12px; } #searchformwrapper {  width:520px;  height:36px;  overflow:hidden;  margin:auto;  padding:0; } label#searchfor {  display:block;  float:left;  width:80px;  padding:0 5px 0 0;  margin:0 0 0 0;  text-align:right; } label#searchin {  display:block;  float:left;  width:20px;  padding:0 5px 0 0;  margin:0 0 0 0;  text-align:right; } #searchphrase {  display:block;  float:left;  width:120px;  margin:7px 0 0 0;  padding:0; } #searchscope {  display:block;  float:left;  width:120px;  margin:7px 0 0 0;  padding:0; } #submitsearch {  display:block;  float:left;  margin:7px 0 0 10px;  padding:0; } 

and here's javascript:

$(document).ready(function() {     $("#searchphrase").autocomplete(     {         source: "/search?json",         minlength: 2     }); }); 

woohoo. found culprit:

<script type="text/javascript" src="/scripts/jquery/132/jquery-1.4.2.min.js"></script>             <script type="text/javascript" src="/scripts/jquery/132/jquery-ui-1.8.custom.min.js"></script>             <script type="text/javascript" src="/scripts/jquery/100325/jquery.dimensions.js"></script>             <script type="text/javascript" src="/scripts/jquery/100325/jquery.tooltip.js"></script> 

don't include jquery.dimensions.js. assume it's in jquery-ui.js ... anyway, fixed problem.

for latest jqueryui need include jquery.ui.position.js


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -