I don’t understand why it doesn’t like my overflow-y syntax?

function show_modal(target){
$(target).modal({
backdrop: true,
keyboard: true
}).css({
width: 'auto',
overflow-y: 'hidden',
'margin-left': function () {
return -($(this).width() / 2);
}
});
$(target).modal('show');
}
The DOM exposes CSS properties as camelcased versions of themselves. Try using
overflowYinstead.As a general note, to put a hyphen in an object key name, you need to use quotes:
I am not sure if jQuery automatically maps the CSS names to the corresponding DOM versions, so it is best to useoverflowYinstead.As Chris Heald has pointed out, jQuery does in fact accept the hyphenated property name as well as the camel cased one, so either of
overflow-y(provided you use quotes) oroverflowYshould work.