jQuery .width (val) ошибка в IE - недействительный аргумент

Еще одна интересная ситуация:

char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE);
char * yourString = myString;

if (myString)
{
    free(myString);
    myString = NULL;
}
// Now this one is safe, because we keep to the rule for 
// setting pointers to NULL after deletion ...
if (myString)
{
    free(myString);
    myString = NULL;
}

// But what about this one:
if (yourString)
{
    free(yourString);
    yourString = NULL;
}

//?!? :)
5
задан 1 June 2009 в 04:30
поделиться

1 ответ

You should try:

var new_width = $('#book_table').width() + 407;
$('body').width(new_width);

Using css('width') is returning a string with the 'px' extension rather than simply a number. Firefox can properly parse "100px" to be 100 with parseInt, but it looks like IE does not.

Using width() will just return an integer, which also removes the need to call parseInt.

10
ответ дан 13 December 2019 в 22:15
поделиться
Другие вопросы по тегам:

Похожие вопросы: