- Where Developers Learn, Share, & Build Careers
Below is a snippet of my jQuery where I'm trying to grab a dropdown and pick an inline width style from it. My problem is that, to get not on Safari II, a
newWidth
is 225. targetSelect r_select
So I can do that for example, why would I return a different width than Safari Firefox?
// Select the current selection box target = Select ($); NewWidth = parseInt (targetSelect.css ('width'));
My Markup:
& lt; Select name = "r_select" id = "r_select" style = "width: 225px; height: 50px; float: left;" & gt; & Lt; Options & gt; Mikelson & lt; / Options & gt; & Lt; Options & gt; Montgomerie & lt; / Options & gt; & Lt; Options & gt; Watson & lt; / Options & gt; & Lt; Options & gt; Casey & lt; / Options & gt; & Lt; / Select & gt;
I should add, that I do not have the same problem with this dropdown:
& lt; Id = "r_select_overlay" class = "r_select_overlay_test no_style" "name =" R_ select_overlay "style =" width: 145px; Height: 50px; Float: left; "& Gt; Option & gt; Mikelson & lt; / option & gt; & lt; option & gt; Montgomerie & lt; / option & gt; & lt; option & gt; Watson & lt; / options & Gt; & lt; option & gt; cc & lt; / option & gt; & lt; / select & gt;
Just try to get the outer width instead of the width and see if it works.