ASP.NET Jquery脚本问题 [英] ASP.NET Jquery Script Issue

查看:99
本文介绍了ASP.NET Jquery脚本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下Jquery脚本不适用于IE 9。知道为什么吗?



它获得标签的最大宽度,并在表格上对齐文本框。这在Chrome和FF中效果很好,但在IE9中却不行。





The below Jquery script doesnt work with IE 9 . Any idea why ?

It gets the max width of the label and aligns the textboxs in line on the form.This works great in Chrome and FF but not in IE9.


$(document).ready(function () {
           var max = 0
           $('div.align').each(function () {
               $(this).find('label').each(function () {
                   width = $(this).width()
                   if (width > max) {
                       max = width
                   }
               });
               $(this).find('label').width(max);
               max = 0
           });
       });

推荐答案

document )。ready( function (){
var max = 0
(document).ready(function () { var max = 0


' div.align')。 ( function (){


this )。find( ' label')。each( function (){
width =
(this).find('label').each(function () { width =


这篇关于ASP.NET Jquery脚本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆