G+1 button during loading ads scrollbar to my site - css

My site have a main div with width set to ~1200px and centered.
if I put g+1 button inside another div which is float:left and div with content on the right side everything works great. Sadly, I would like to put this button on the right side of my content. In this situation during loading this button ads horizontal scrollbar for one second.
I know about this: google +1 button adds scroll bar to my site
but it not work for me.
I'm googling about it, but every solution is similar to this I linked above.
[EDIT] IE & FF only

Only one solution I found is load g+1 button to hidden div, and show this div with some delay.
Social div contains three social-* divs for facebook, googleplus and twitter.
$('#social-fb').css("opacity", "0.0");
$('#social-gp').hide();
$('#social-tw').hide();
$('#social-fb').html('...');
$('#social-gp').html('...');
$('#social-tw').html('...');
timeoutID = setTimeout(function(){
$('#social').hide()
$('#social-fb').css("opacity", "1.0");
$('#social-gp').show();
$('#social-tw').show();
$('#social').fadeIn(500);
}, 2000);

Related

Ionic-Angular can't get list to scroll properly

I've been trying to programmatically scroll a list (accordion) in an Ionic-Angular app and I’ve been having no success at all.
I reproduced it in this stackblitz: https://stackblitz.com/edit/stack-overflow-ionic-scroll-problem?file=src/app/home/home.page.ts
When you click on an item, it expands and I want it to align to the top of the screen (with the title visible). In this example, I am using scrollIntoView() to get it to the top but it disappears behind the toolbar.
I've tried many things to get it to align properly (including setting a "scroll-margin-top" as suggested on many posts) but this hasn't worked for me.
Also, I can't seem to be able to use the scrollBy() or scrollTo() method... they do nothing at all.
Can anybody help me figure this out and get this precise example to work? Thanks in advance!
The problem is in the property [fullscreen]="true" of the <ion-content> tag.
The property fullscreen of ion-content, according to the ionic documentation...
If true, the content will scroll behind the headers and footers. This effect can easily be seen by setting the toolbar to transparent.
In ionic when you use the option fullscreen as in <ion-content [fullscreen]="true"> it adds the following style to the ion-content tag:
--offset-top: 56px;
The goal of the [fullscreen]="true" is to create the effect of the content scrolling behind the header.
As a side effect, part of the <ion-content> is hidden behind the <ion-header>.
Fullscreen property and scrollIntoView()
According to w3schools...
The scrollIntoView() method scrolls the specified element into the visible area of the browser window.
So, in your code, when you call scrollIntoView() of a group it is working exactly as expected. The screen is scrolled until the top o the group is into the visible area of the browser. The problem is that the <ion-header> is covering part of the top of this visible area.
Solution:
If you remove the [fullscreen]="true" of the <ion-content>tag the scroll will work as you expect.
But you will loose the effect created by the fullscreen property (content scrolling behing the header).
References
Fullscreen property of ion-content tag:
https://ionicframework.com/docs/api/content
ScrollIntoView:
https://www.w3schools.com/JSREF/met_element_scrollintoview.asp

Overflow scroll and show context menu

I've got div with overflow="scroll" on it, which is displaying content (icefaces app). I've got event for right mouse button with displaying context menu of element of this content, but context menu is displaying inside of this div, i must scroll to see this context menu. This context menu is hidden div - after mouse click it's set to visible.
It's physically putted inside of scroll panel (and it unfortunatelly must be inside). Anyone have idea how to resolve this problem (i tried everything from google). Maybe some js trick or something like that? ;)
Problem is that i need it out of this scroll ;)
Thanks a lot.
Matthew

jquery mobile sidebar not expected drag

I'm working on a phonegap app that has a fixed sidebar behind the page and I found an behavior issue.
The sidebar is hidden, the user can see it with a tap on a menu icon. When the user tap on he icon the page go to the right and it shows the sidebar that is in a minor z-index.
If the user want to close the menu he have to drag the visible part of the page to the left.
My problem was that in the sidebar I have a block that is vertically scrollable. It works fine but the thing is, if I put the .scroll (overflow-y: scroll; -webkit-overflow-scrolling: touch;) class in this element and the user swipe horizontally from right to left over it the sidebar and the page start a drag.
We're using snap.js for the sidebar interaction.
I want to disable this drag. I tried with CSS and preventing horizontal scroll but it doesn't work.
I attach a pic for more visual details.
Use iScroll5 for scrolling.
Then hook into the onScrollStart event:
myScroll.on('beforeScrollStart', function(event)
{
if (isPanelOpen){
myScroll.disable();
}
else{
myScroll.enable();
}
});
Or - if you not wanna use iScroll5, you can set a global bool, which indicates, if a panel is open (you've gotta do this anyway).
If a Panel is open (meaning, you're showing the sidebar) set the bool to true in snap.js - this subsequently means, you've gotta tweak snap.js.
Then, on touchmove, check the bool if it is true. Then you know, a panel is open, and you can do a event.stopPropagation on touchmove in order to prevent the event bubbling up to get recognized by snap.js and avoid the panels closes too early.
Woop! We found it!
The problem was that we're catching the touchmove event for each element with .scroll class and we're stoping the propagation of it.
We had notice that when we tried to start a horizontal scroll all page was moving like a drag so we added this CSS property:
html, body, .ui-mobile .ui-page-active { overflow-x: hidden; }
And...it works fine!
P.S. we don't actually need the horizontal scroll in any element, so, this is fine for us.

Fancybox for Wordpress - dynamically resize width based on content

I'm using Fancybox for Wordpress to display a form.
Within the fancybox is a div with id "popup1", which contains the form.
When the user submits the form, #popup1 disappears, and #popup2 appears. div#popup2 just has a little "Thank you" message that is very short.
The height of the fancybox window automatically resizes to fit the height of the content when I switch from popup1 to popup2, but I want the WIDTH of fancybox window to shrink also. How can I do that?
Thanks in advance!
You have several handlers to flip from one pop-up to another like
$("#popup4-BA").slideDown("slow");
Try adding the fancybox (v1.3.4) method $.fancybox.resize() after completing the animation like
$("#popup4-BA").slideDown("slow", function(){
$.fancybox.resize();
});
... you may need to do this in every handler.
Some Notes:
you first pop-up has a fixed width so you may need to try removing it and set the css width property to auto.
since you are using fancybox v1.3.4 with inline content, you need to be aware of this BUG and workaround.

jquery tabbed content creates page shift

I am using jquery tabbed content and I have noticed when navigating to any tab other than the product tab the page shifts a few pixels to the right and then when clicking the product tab it shifts back. What in the world is causing this?
The link to see it in action, http://clients.zerozendesign.info/techject/
The reason is the presence of the scroll bar on the long page content on the products tab. You should consider displaying the scroll bar even when the content does not require it using the CSS property for overflow, like so:
html { overflow-y:scroll; }

Resources