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

  • SEARCH
  • Home
  • 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 8654969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:55:05+00:00 2026-06-12T14:55:05+00:00

It’s the super-boring super-annoying IE-select-box issue! I had solved it successfully… JQUERY: $(function(){ if($.browser.msie){

  • 0

It’s the super-boring super-annoying IE-select-box issue!

I had solved it successfully…

JQUERY:

$(function(){
    if($.browser.msie){
        $("select:not(#wrkTimeFrm,#wrkTimeFrm1,#wrkTimeTo,#wrkTimeTo1)")
            .focus(function(){
            $(this).css("width","auto");
            $(this).css("position","absolute");
        });
        $("select:not(#wrkTimeFrm,#wrkTimeFrm1,#wrkTimeTo,#wrkTimeTo1)")
            .blur(function(){
            $(this).css("width","145px");
            $(this).css("position","inherit");
        });
    }
})

…but that was only until now.

As you can see the :not(id)s are the select boxes whose size is/should be less than 145px, i.e. it should not change. It was working fine. But the list of such select boxes is way too much to handle that way. Moreover the ids are dynamic and I’ve no idea whose width is more/less than 145px(the options are dynamic…obviously).

So now, I’m trying to update the width of select box only if the its auto width is more than its current width.
Something like:

$(function(){
    if($.browser.msie){
        $("select").focus(function(){
            if(autoWidth>currentWidth){
            do_the_rest();
            }
        });
    }
});

And I’m running sort of ideas for ‘autoWidth’ and ‘currentWidth'($(“.dd”).outerWidth() gives the width as 145, but I’m afraid if I can use it for currentWidth as I got more than one select boxes on same jsp with same css class ‘dd’, although event is fired for ‘this’ select box only. May be someone could let me know how to get the class name of the select box under focus…maybe!…..and than the outerWidth.).

So please help!

  • 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-12T14:55:06+00:00Added an answer on June 12, 2026 at 2:55 pm

    I’m finding it really hard to understand what you mean, specially because you didn’t include any fiddles or even the generated HTML code… but I think maybe what you want to do is this:

    $(function(){
        if($.browser.msie){
            $("select").focus(function(){
                if($(this).width()>145){
                  $(this).css("width","auto");
                }
            });
        }
    });
    

    UPDATE:

    $(function() {
        $("select").focus(function() {
            if ($(this).width() > 95) {
                var prevWidth = $(this).width();
                $(this).css("width", "auto");
                if ($(this).width() < 100) {
                    $(this).css("width", 100 + "px");
                }
                $(this).blur(function() {
                    $(this).css("width", prevWidth + "px");
                });
            }
    
        });
    
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.