WordPress.org

Forums

WP jQuery Lightbox
[resolved] Tip for responsive/mobile minimum margins (2 posts)

  1. buymylife
    Member
    Posted 1 year ago #

    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/

  2. ulfben
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed in 1.4.5. Thanks for reporting.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP jQuery Lightbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic