Advertise with us

JQuery model dialog position not fixed

Posted by  Takeshi Okada
 3553  View(s)
Rate this:

Hi Everyone!

I'm working on MVC 4 project. In this project I have used model dialog that provide by MVC 4. This model dialog scroll with screen. I want to fixed model dialog in screen center.

I have used below line of css and jQuery.

 <link href="@Url.Content("~/Content/themes/base/minified/jquery-ui.min.css")" rel="stylesheet" type="text/css" />
 <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
 <script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>

Please help me!

Thanks in advance!

  1. Re: JQuery model dialog position not fixed

    Hi Takeshi!

    If I'm right, then you are using MVC JQuery and CSS for creating this model popup.
    Hence, for fixing position of model popup, open "jquery-ui.min.css" file from Content\themes\base\minified folder and change ".ui-dialog" class position

    absolute to fixed as following.

    position: fixed;

    I hope it resolve your problem.