locked
How to set pop up using jquery RRS feed

  • Question

  • How do i set Pop-up using jquery for each system resolution

    my code is follows

    $(document).ready(function () {
      var adjustWidth =350;
      $("#id").dialog({
      autoOpen: false, 
      height: 600,
      width: (screen.width - adjustWidth),

    }

    But it crash for lowest resolution




    • Edited by G143 Friday, August 8, 2014 11:05 AM
    Friday, August 8, 2014 11:04 AM

All replies

  • The issue you are probably having is screen.width

    Maybe try something like a default.

    var swidth = screen.width || 800,

    mywidth = swidth - adjustWidth;

     $("#id").dialog({
      autoOpen: false, 
      height: 600,
      width: mywidth,



    which would default to 800 if screen.width is null or undefined.

    See if that works.

    Friday, August 8, 2014 2:13 PM