New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update slidebars.js - sb-style-overlay init error #132
Conversation
PROBLEM: When page load, the Slidebars with "sb-style-overlay" class take a right margin when "sb-right" and a left margin when "sb-left". After open one first time, the error dead and the slidebars are correted. SOLUTION: Apply the margin-[right/left] in the "transform: translate([value])" value. Thanks for the plugin! :D
Hi there, Thanks for contributing, but I'm not sure what the problem is in the first place? Could you explain it further? Thanks, Adam |
Hello, I think I know what he's talking about as I noticed the same issue on my website. |
What version of Slidebars are you using? There was an issue pre 0.10 that with offset margins. |
I am using 0.10 |
Your not using the proper css file, it looks like you've shredded it apart, there are huge parts of it missing. I can't support you on this one. |
Adam, I'm using 0.10.1 css file. If this issue has been correted, please disconsider this one. @mnakalay, if you have the same problem and use an old version like me, download and use the new version code or make my adjustment in your slidebars.js file and it will works fine. Thanks. |
I'm still interested in this if it is a problem, but I can't replicate it. I'm using overlay styles on the Slidebars website (the right one), but it works fine. Do you have a demo site where this error occurs? |
I only modified the css as far as your instructions allow. I do however use a grunt task that moves things around to gather media queries together but I am pretty certain that other than that all your css is there. I do however see that on your site it is working so I'll look in my css and see what's happening. Once again the strange thing is not so much the extra margin, it's that it only appears on first click and not after that. |
Adam, your own website has the issue. But in your site the issue is almost imperceptible. Depends the each project's css and the page size, this issue can be more perceptible. I take a print from your own website, the issue is marked in image below. Send me a message at easy if you can't understand yet.
|
Ahh I see, thanks for pointing it out. It doesn;t seem to happen on Firefox/Mac for me. I'll take a look into your pull request and test it, thanks for the help. Adam |
I'm happy to can help u. Thanks for the great slide plugin! |
@mnakalay Ahh, I think you may have just updated the js file then and not the CSS. From 0.10 it uses |
Hi again, I have added padding and a border to the slidebar AND It is correctly set to box-sizing: border-box; Once again, the problem exist only on first opening. After that the value is correct. |
Hi, Ok thanks for letting me know. I'll be sure to look into this fix when I can. Adam |
Hi, Thanks for the great plugin Adam. |
Hi Elias, I'm afraid not :( I'm not currently working on Slidebars at the moment, i'll continue on it early next year some time. I have a minor update ready to release but it doesn't target this. Thanks, Adam |
I found a solution: function initialise() {
if (!settings.disableOver || (typeof settings.disableOver === 'number' && settings.disableOver >= windowWidth)) { // False or larger than window size.
init = true; // true enabled Slidebars to open.
$('html').addClass('sb-init'); // Add helper class.
if (settings.hideControlClasses) $controls.removeClass('sb-hide'); // Remove class just incase Slidebars was originally disabled.
} else if (typeof settings.disableOver === 'number' && settings.disableOver < windowWidth) { // Less than window size.
init = false; // false stop Slidebars from opening.
$('html').removeClass('sb-init'); // Remove helper class.
if (settings.hideControlClasses) $controls.addClass('sb-hide'); // Hide controls
$site.css('minHeight', ''); // Remove minimum height.
if (leftActive || rightActive) close(); // Close Slidebars if open.
}
} and call css() when the slidebar will open function proceed() {
if (init && side === 'left' && $left) { // Slidebars is initiated, left is in use and called to open.
$('html').addClass('sb-active sb-active-left'); // Add active classes.
$left.addClass('sb-active');
css();
animate($left, $left.css('width'), 'left'); // Animation
setTimeout(function() { leftActive = true; }, 400); // Set active variables.
} else if (init && side === 'right' && $right) { // Slidebars is initiated, right is in use and called to open.
$('html').addClass('sb-active sb-active-right'); // Add active classes.
$right.addClass('sb-active');
css();
animate($right, '-' + $right.css('width'), 'right'); // Animation
setTimeout(function() { rightActive = true; }, 400); // Set active variables.
}
} this works for me, but i don't know if it's the correct solution. Elia |
Sorry for the delay, I'm closing this now as the main file have changed considerably for the new version |
PROBLEM: When page load, the Slidebars with "sb-style-overlay" class take a right margin when "sb-right" and a left margin when "sb-left". After open one first time, the error dead and the slidebars are correted.
SOLUTION: Apply the margin-[right/left] in the "transform: translate([value])" value.
TEST: Only in Chrome 37.0.2n m
Thanks for the plugin! :D