这段代码只是抛出我试图强制我的宽度适合所有的交叉,而不是采取最长的字符串,并使宽度的大小是它的状态现在。我对这一切都很陌生,不确定自己是否理解正确。请帮助任何意见将不胜感激..谢谢
if($.browser.msie && parseInt($.browser.version, 10) < 8)
{
var relevantDropdowns = $('select[name*="codeValue"]');
relevantDropdowns.mousedown(function()
{
if($(this).css('width')!== 'auto');
{
$(this).css('width', 'auto');
$(this).css('position', 'absolute');
}
});
relevantDropdowns.blur(function()
{
$(this).css('width', '100px');
$(this).css('position', '');
});
relevantDropdowns.change(function()
{
$(this).css('width', '100px');
$(this).css('position', '');
});
}
欢迎来到SO。你到底需要什么帮助? – 2011-12-29 21:00:28
如果您真的只想知道$正在做什么,请阅读以下内容:http://docs.jquery.com/How_jQuery_Works – Chris 2011-12-29 21:03:19
jQuery的['.browser'](http://api.jquery.com/jquery.browser /)已弃用。这意味着它可以并且*将*在不久的将来会在没有警告的情况下停止工作。如果您没有使用特定的jQuery旧版本,请更改您的“if”以尝试特征检测或替代方法。 – 2011-12-29 21:03:52