jqueryui dialog positioning

前端 未结 8 826
抹茶落季
抹茶落季 2020-12-24 03:09

I am using JQuery UI and would like to position my dialog horizontally centered but vertically above center, maybe by a fixed amount of pixels or a relative distance from th

相关标签:
8条回答
  • 2020-12-24 04:00

    apply css into your #dialog-form use % sample

    if width = 1000

    put

    left:50% margin-left:-500px;

    to make it centered. or you can use iframe.

    0 讨论(0)
  • 2020-12-24 04:03

    If anyone is creating a link that opens a jQuery dialog due to the link's class having a click event handler, you may notice that it might jump to the top of the page but create the modal dialog deeper down the page and you have to scroll to it.

    If anyone is just trying to stop the jQuery dialog from jumping to the top, wanting it to stay near the link you clicked, just remove href. Nearly went mad trying to solve this. The HTML5 specification apparently understands href="" or href="#" to mean move to the top.

    0 讨论(0)
提交回复
热议问题