• Resolved WebMat

    (@webmatpro)


    Hi,

    thanks for your great plugin.

    Can you add the offset when the admin-bar is enable please.

    In your JS, line 227 :

    if ( $(‘body’).hasClass(‘admin-bar’) ) {
    var AddOffsetTop = 32;
    } else {
    var AddOffsetTop = 0;
    }
    var windowOffsetTop = AddOffsetTop + options.additionalMarginTop;

    Thanks you,

    Mat.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Matt,

    Thank you for your suggestion. I made fix to my plugin, but I made it in plugin php file, before js is even fired. I think it should be better this way and faster. Instead of js searching for admin-bar class every time plugin is loaded, there is native wp function is_admin_bar_showing()

    This is the code added at line 458 to mystickysidebar.php:

    if ( is_admin_bar_showing() ) {
    	$aditionalmargintop = $mystickyside_options['mystickyside_margin_top'] + 32;
    	} else {					
    	$aditionalmargintop = $mystickyside_options['mystickyside_margin_top'];
    }

    Anyway, updated version 1.2.4 is out so feel free to try it and let me know if it works for you

    Thread Starter WebMat

    (@webmatpro)

    Hi,

    yes work fine,

    thanks 🙂

    • This reply was modified 8 years, 10 months ago by WebMat.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Can you admin my code please’ is closed to new replies.