4

I am still a relative beginner with jquery so any help is gratefully appreciated.

I took the simplemodal function and changed the positioning from fixed to absolute as I wanted the modal box to be able to be scrolled with the background page. This is causing me a problem as somewhere (I presume in the jscript) the top position is being set so I can't override it in the external css.

Can anyone tell me how I can change the inline css for simplemodal-container?

Thanks!

Loonytoons
  • 43
  • 1
  • 3

1 Answers1

8

The following should work:

// replace #foo with your id or element
$('#foo').modal({onShow: function (d) {
    // replace '0px' with your value, or remove the property
    d.container.css({position: 'absolute', top: '0px'});
}});

Note: This does not work in IE6

Eric Martin
  • 2,841
  • 2
  • 23
  • 23
  • Thanks @eric-martin ... I must be doing something wrong...or using the wrong id. I've been using #simplemodal-container but it seems to break the code - it does not produce a popup. – Loonytoons May 29 '11 at 15:57
  • You should be using the id of the element you want to display. simplemodal-container is something SimpleModal uses internally. – Eric Martin May 29 '11 at 17:54