Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9113649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:00:43+00:00 2026-06-17T04:00:43+00:00

Jquery autocomplete is being used.On hover over an item in the dropdown list, the

  • 0

Jquery autocomplete is being used.On hover over an item in the dropdown list, the item gets highlighted with a different background colour. But if the dropdown has a horizontal scrollbar, on scrolling the highlighted bacground does not extend till the right edge of the box.
How to make sure that the highlighted background will extend all the way to the edge of the autocomplete textbox for each item in the list?

html sample structure

<div id="AutocompleteContainter_div" style="position: absolute; z-index: 9999; top: 86px; left: 1135px;">
<div class="autocomplete-w1 ">
<div class="autocomplete" id="Autocomplete_div" style="max-height: 1200px; width: 245px; display: block;">
<div title="City of Origin,Power Play Goals,Salary" class=""><strong>City</strong> of Origin,Power Play Goals,Salary</div>
<div title="City of Origin,Standing in Conference,Salary" class="selected"><strong>City</strong> of Origin,Standing in Conference,Salary</div>
<div title="City of Origin,Team,Penalty Minutes Served,Salary" class=""><strong>City</strong> of Origin,Team,Penalty Minutes Served,Salary</div>
<div title="City of Origin,Standing in Division,Shots on Net,Salary" class=""><strong>City</strong> of Origin,Standing in Division,Shots on Net,Salary</div>
<div title="City of Origin,Position,Penalty Minutes Served,Salary" class=""><strong>City</strong> of Origin,Position,Penalty Minutes Served,Salary</div>
<hr class="line"><font color="#B9B9B9" size="1">&nbsp;<b>Columns</b></font><div title="CITY" class=""><strong>CITY</strong></div>
<div title="City of Origin"><strong>City</strong> of Origin</div>
</div>
</div>
</div>

css

.autocomplete-w1 {

background:no-repeat bottom right;
position:absolute; 
top:0px; 
left:0px; 
margin:8px 0 0 6px; /* IE6 fix: */ _background:none; _margin:0;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif; 
font-size:11px;color: #333; 
}
.autocomplete { 
border:1px solid #999; 
background:#FFF; 
cursor:default; 
text-align:left;
 max-height:350px;
 overflow:auto;
 margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px;  _margin:0; _overflow-x:hidden;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif; 
        font-size:11px;color: #333;

 }
.autocomplete .selected {

background:#B8B8B8; 

}
.autocomplete div { 
padding:2px 5px; 
white-space:nowrap; 
}
.autocomplete strong { font-weight: bold;
    color: #000;
    background-color: #fff6e1; }

.autocomplete .line {
border-top: 1px solid #ffffff;
border-bottom: 1px solid #6D7B8D;
height: 2px;
margin: 4px 0px;
text-align: center;
padding: 0px;
line-height: 2px;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:00:44+00:00Added an answer on June 17, 2026 at 4:00 am

    I understand your issue. In this case as you set width 245 to the div “autocomplete”, the child divs have only this width.

    But we need to get the full width of the content(max). So for this, I have added one div before the inner divs and set “display:inline-block” to get the width of the content(max).

    I have modified your code and it is working now.

    <div id="AutocompleteContainter_div" style="position: absolute; z-index: 9999; top:     0px; left: 35px;">
    <div class="autocomplete-w1 ">
    <div class="autocomplete" id="Autocomplete_div" style="max-height: 1200px; width: 145px; display: block;">
    <div style="display:inline-block;">
    <div title="City of Origin,Power Play Goals,Salary" class=""><strong>City</strong> of Origin,Power Play Goals,Salary</div>
    <div title="City of Origin,Standing in Conference,Salary" class="selected"> <strong>City</strong> of Origin,Standing in Conference,Salary</div>
    <div title="City of Origin,Team,Penalty Minutes Served,Salary" class=""><strong>City</strong> of Origin,Team,Penalty Minutes Served,Salary</div>
    <div title="City of Origin,Standing in Division,Shots on Net,Salary" class=""><strong>City</strong> of Origin,Standing in Division,Shots on Net,Salary</div>
    <div title="City of Origin,Position,Penalty Minutes Served,Salary" class="">   <strong>City</strong> of Origin,Position,Penalty Minutes Served,Salary</div>
    <hr class="line"><font color="#B9B9B9" size="1">&nbsp;<b>Columns</b></font><div title="CITY" class=""><strong>CITY</strong></div>
    <div title="City of Origin"><strong>City</strong> of Origin</div>
    </div>
    </div>
    </div>
    </div>
    

    You can check it here : http://jsfiddle.net/pitchaip/6uqTJ/3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone used jQuery to populate an autocomplete list on a textbox using ASP.NET
jQuery autocomplete docs state there should be two Models, the first being the model
I have being using jquery autocomplete. By default it is showing 10 items in
I'm using jQuery autocomplete which makes a UL with items like: <li class=ui-menu-item role=menuitem>
Lots of style-related jquery autocomplete questions (yow), but none that want to "match the
I'm using the jquery UI autocomplete plugin. The value that is being returned contains
I am trying to create a JQuery Autocomplete box where the words being suggested
Recently I started using https://github.com/crowdint/rails3-jquery-autocomplete It works great, but I was trying to set
I am using jQuery's Autocomplete plugin, and the list of suggestions are generated dynamically.
I am generating a list using jquery-ui autocomplete. I would like to apply a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.