Support » Plugin: WP jQuery Lightbox » Tip for responsive/mobile minimum margins

  • Resolved buymylife

    (@buymylife)


    Howdy — Frequent user here, building something custom with your great plugin. Wanted to pass along a quick feature I just added, might be worth fitting into a next iteration…

    Building a responsive version of a site; I wanted a 150px min margin on my primary desktop version and no margin on my mobile version (less than 500px). Can’t css it as that dimension is calculated, so just changed this:

    if (opts.fitToScreen){
    var displayHeight = maxHeight-opts.marginSize;
    var displayWidth = maxWidth-opts.marginSize;

    to this:

    if (opts.fitToScreen){
    if ( $(window).width() < 500) {
    var displayHeight = maxHeight;
    var displayWidth = maxWidth;
    }
    else {
    var displayHeight = maxHeight-opts.marginSize;
    var displayWidth = maxWidth-opts.marginSize;
    }

    Might not be the most elegant solution, but it works… and thought it might be worth considering another variable in the wordpress admin — something like “min margin for mobile”. Or whatever! Just an idea that I wanted to pass along!

    Thanks again!

    http://wordpress.org/extend/plugins/wp-jquery-lightbox/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Tip for responsive/mobile minimum margins’ is closed to new replies.