I've created a few sites with facebook like button in the footer.
However, the popup that appears after you like a page, is not visible, so I'd like to move it over the like button.
So that this wouldn't happen.
How could I target the html5 implemented like button?
<div class="fb-like span6" data-href="https://www.facebook.com/pages/xxxxxx?fref=ts" data-send="true" data-width="450" data-show-faces="false" data-action="like" data-font="segoe ui"></div>
And what css would I need to apply to it?
Unfortunately you can't really get the popup to move independently of the button, because once the button is clicked it opens the widget in an iframe and you won't be able to affect the contents of the iframe with out playing with the same origin policy. Apparently there are Ways to circumvent the same-origin policy but its probably way more of a headache than it's really worth for something like this.
However, if you just want the iframe opening above the edge of the window you could move the iframe around like this:
.fb_iframe_widget iframe {
position:absolute;
top:-165px;
background:#fff; /* in your case you may want to add a white background */
}
Also you'll need to remove overflow:hidden from #footer.
You should end up with this:
I know it's not ideal, but given Facebook's lack of interest in being particularly developer friendly it is likely as close as you can get to what you're after.
Update:
Wrap the whole widget in a div and position the div where you had it to begin with. Then you can you use the following CSS to position the iframe.
.fb_iframe_widget iframe {
position:absolute;
top:-165px;
background:#fff;
right:10px;
}
#media (min-width:1200px) {
.fb_iframe_widget iframe {
position:absolute;
top:-165px;
background:#fff;
right:-45px;
}
}
#media (max-width:979px) and (min-width: 768px) {
.fb_iframe_widget iframe {
position:absolute;
top:-165px;
background:#fff;
right:110px;
}
}
#media (max-width:767px) {
.fb_iframe_widget iframe {
position:absolute;
top:-165px;
background:#fff;
right:0px;
}
}
a) you should change your footer's height, it won't affect much your design, even your responsive options, it could be like this:
#footer {
margin-left: 0;
height: 230px;
background: #fff;
border-top: 1px solid whiteSmoke;
}
or...
b) you can put the like button in your side bar without changing any css, i will look something like this:
http://puu.sh/3Srmq.png
I have a compromise solution too.
After user clicked the like button, scroll window untill widget totally shows up by callback function.
Code looks like
FB.Event.subscribe('edge.create', function(response) {
$('html, body').animate({
scrollTop : $("#yourFacebookWidgetID").offset().top + 170 //add offset.
}, 10);
});
Here is the fiddle.(I borrowed this instance, Somebody made it long time ago.)
Here is the screenshots.
After clicked the like button, just before auto scroll.
And this is the screen after auto scrolling finished.
Please notice the last like button.
Edited : add the 170px offset .
Add screenshots.
That's what worked out for me.
.wrap-parent {
zoom: 1; //or your clearfix class
}
.wrap {
overflow: visible;
}
The html will be something like
<div class='wrap-parent>
<div class='wrap'>
<!-- button here -->
</div>
</div>
Related
I have been searching all over the internet how to fix this. Basically I need the button on the right side on desktop view. See below:
chrome view
But when you resize it or viewed on mobile devices, it should be in full width but I cannot do it. see below:
mobile view
This is a sticky or scrolling menu as well. Here are my codes:
/* call button small*/
.buttonfloat-small{
position:fixed;
bottom:0px;
text-align:center;
z-index: 99;
display:block;
width:100%;
margin: auto;
}
Thank you!
You can do this by using:
.buttonfloat-small div a.fl-button {width:100%}
.buttonfloat-small div {margin:0!important}
OR by directly targeting the nodes:
a.fl-button {width:100%}
.fl-node-5907a486bf15a > .fl-module-content {margin:0}
Which will make it look like this: https://i.stack.imgur.com/epv0B.png
Side Note: The important override on the first div is to remove the 20px right margin from the ".fl-node-5907a486bf15a > .fl-module-content". Calling on it directly doesn't require the important tag (hence both examples).
This has to be put into your Media Queries to make it only appear full width when resized, like:
#media (max-width: 768px){
.buttonfloat-small div a.fl-button {width:100%}
.buttonfloat-small div {margin:0!important}
}
Changing the text to change from Call Us On to Call Now, I'd personally do with JQuery like this:
$(document).ready(function() {
var button = $(".buttonfloat-small div a.fl-button span.fl-button-text"),
resize = function() {
if (window.matchMedia('(max-width:767px)').matches) {
button.html("Call Now 0330 838 1828");
} else {
button.html("Call Us On 0330 838 1828");
}
};
$(window).resize(resize);
resize();
});
This will check if the width it 767 and if so then it will show Call Now, else it will show Call us and will also change when the window is resized.
Here's a JSFiddle showing the effects: https://jsfiddle.net/awwy5ram/1/
Let me know if you require more assistance!
I have an absolutely positioned logo in the header bar of my page, that keeps moving down the page when scrolled.
I do not want this behavior, I want the logo to stick to the top of the page and not cover other elements when a visitor is scrolling down the page.
Here is the page in question.
www.giracci.com
and the header logo code.
logoWrapper {
float: left;
height: 0;
position: absolute;
top: 0;
width: 150px;
z-index: 30;
}
If you view the page, you'll see that it doesn't stay put, it scrolls with the page.
First:
Copy the relevant HTML and CSS to your question. There's MUCH more to the equation that you have not included. You need to essentially include all the html up to the nav container, as well as the CSS, and indicating that your question includes bootstrap (I've already done that for you).
Second:
The reason that it's exhibiting this behavior is because one of it's containers - the nav#site-navigation - is getting a fixed class applied to it when you scroll, which applies the following styles:
nav.fixed {
position: fixed;
visibility: hidden;
opacity: 0;
}
And, because you are using the bootstrap class of visible-lg on the logo wrapper, it gets this style:
.visible-lg {
display: block !important;
}
Which overrides the .fixed hidden property.
And, because the logo is inside that wrapper, that causes the logo to show up when you don't want it to.
So, you're using colliding classes, and need to straighten them out.
Add this to your css file:
No need to change much of the code.
your navbar is adding fixed class when it is scrolled.
nav.fixed .logoWrapper {
display: none;
}
First of all I would change these parameters in the css to display correctly the nav, to make sure that the menu items do not go below the logo:
.container {
width:auto;
}
.container.nav-bar {
width:auto;
margin:0 60px;
}
After you've done this, if you want to hide everthing when you're scrolling the page (logo and nav), add this to your css:
nav.fixed.scrolled {
display:none;
}
however, if you want that the only logo is fixed when you're scrolling the page add and edit these parameters on the CSS:
.logoWrapper {
position:fixed;
}
There is one more way around you can try. Because currently on your site it disappears at once so it feels like there is kind of a glitch/stutter, very slight. I needed something like this with my logo so I did it with JS. And it works like a charm. Here is the following code:
$(window).scroll(
function () {
var top = 75;
var currentTop = $(window).scrollTop();
if (currentTop > top) {
$(".logo").css("opacity", "0");
} else {
$(".logo").css("opacity", "1");
}
});
Simply replace .logo with your .logowrapper or whatever. Hope it works.
I'm coding a comment page on my website and it all works fine, but when you make it bigger part of my pages (notifications) move across the page. I've coded the text area to the position I wanted using position relative. Here is the css code I've use:....
#mainSection{
text-align:left;
margin-top:3px;
margin-bottom:50px;
margin-left:270px;
position:relative;
bottom:650px;
}
#mainSection .newPost{
width:500px;
height:125px;
}
You can prevent the user from resizing the textbox altogether:
textarea {
resize: none;
}
I am making a website for someone and I want it to resize itself depending on the screen resolution and the zoom of the browser(I am not including smartphones). I currently have a menu wich is like that :
every element in the menu is in a div and here is the css:
#barre_utilisateur //For the menu bar(the red bar)
{
height:45px;
background-color:#A31E39;
width:100%;
}
#content_boutton_accueil //the home button
{
margin-left:2%;
width:200px;
display:inline-block;
}
#notification //exclamation mark button
{
cursor:pointer;
width:60px;
height:45px;
display:inline-block;
}
and now, I want the cogwheel icon the stick on the right on the left of the user button. I don't see how I can achieve this.
Also, when I zoom in too much the righ part of the menu get out of where it is supposed to be is there a way to prevent this?
A good example of what I am trying to achieve is the new outlook live page
You can position the overall menu div (#barre_utilisateur) relatively, and then its children absolutely in it. For example:
#barre_utilisateur {
position: relative;
}
#cogwheel {
position: absolute;
right: 0;
}
Another way could be to have 2 divs inside the menu (#barre_utilisateur), and then to float the first one to the left and the other - to the right.
I created a overlay which i am using to show while doing ajax requests. In firefox it works great! But in IE7 i don't see the Div.
my div is simple its the first element after Body
<div id="overlay">
</div>
and my css is here
#overlay {
z-index:1000;
position:absolute;
top:0;
bottom:0;
left:0;
width:100%;
background:#000;
opacity:0.45;
-moz-opacity:0.45;
filter:alpha(opacity=45);
display:none;
}
I think it maybe something to do with the sizing as i placed some text in the div and i don't see it on IE7 but i do on firefox.
Does anyon know where its not working, i am at a bit of a loss :-)
I tried removing display:none and its the same and i also inserting height:auto and still no joy.
I am using jquery to show and hide it liek so, but this isn't the problem as i removed Display:none and i don't see the div which should be over the top of the rest of the content
$("#overlay").show();
Any ideas?
Thanks in advance
since your div is positioned in absolute you should specify an height (different than auto). This can be done declaring height:100% to #overlay , then also html, body { height: 100% } when you open the overlay and html, body { height: auto } when closing the overlay);
Another (better) way is to dinamically calculate the height of body elements via javascript (e.g. document.body.offsetHeight) and then assign to the #overlay as a height
document.getElementById('overlay').style.height = document.body.offsetHeight + 'px';
this would be written in you jQuery snippet as
$("#overlay").height($('body').height()).show();
Try the following additional CSS:
#overlay {
zoom: 1;
}