View Full Version : How add floating ads in left and right vb4
Emad ELsayed
03-11-2017, 01:50 PM
welcome everybody
How add floating ads in left and right vb4 ?
This code works
<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 0px;"> Google AdSense Code </div>
<div id="LeftFloatAds" style="Left: 0px; position: fixed; text-align: center; top: 0px;"> Google AdSense Code </div>
But when minimize the window size of the Forum .. comes in the background
Is there a way to fit with Style
KevinL
03-11-2017, 01:58 PM
You can check out this mod
https://vborg.vbsupport.ru/showthread.php?p=2570099#post2570099
bzcomputers
03-11-2017, 02:32 PM
This information below will only work correctly on fixed width sites...
Say for example your site has a fixed width of 800px centered on the screen, and then your side banners are a width of 160px each. That will require a minimum of 1120px total to show everything (without any margins). Now, you can take into account a small margin between ads so everything doesn't show right on top of each other, so we'll add 80px (20px on both the left & right side of each ad) for a total of 1200px.
We'll now need to write css code to say don't show those sidebar ads when the screen is less than 1200px wide.
@media screen and (max-width: 1199px) {
#RightFloatAds, #LeftFloatAds {
display: none;
}
}
You can add this code to additional.css template. Then confirm it is working like desired by manually adjusting your screen width.
yilmaz
03-11-2017, 02:51 PM
Would it be this product?
Screenshot
155989
Emad ELsayed
03-11-2017, 06:50 PM
You can check out this mod
https://vborg.vbsupport.ru/showthread.php?p=2570099#post2570099
Dear Sorry it did not work 4.2.4
This information below will only work correctly on fixed width sites...
Say for example your site has a fixed width of 800px centered on the screen, and then your side banners are a width of 160px each. That will require a minimum of 1120px total to show everything (without any margins). Now, you can take into account a small margin between ads so everything doesn't show right on top of each other, so we'll add 80px (20px on both the left & right side of each ad) for a total of 1200px.
We'll now need to write css code to say don't show those sidebar ads when the screen is less than 1200px wide.
@media screen and (max-width: 1199px) {
#RightFloatAds, #LeftFloatAds {
display: none;
}
}
You can add this code to additional.css template. Then confirm it is working like desired by manually adjusting your screen width.
Thank you very much dear
Everything is fine now
I set the maximum width of 1000 Ad 2unit 160 and the total in 1250
Is this good for you ??
Best Regards
Would it be this product?
Screenshot
155989
Works
But when minimize the window size of the Forum ... It appears on the forums
webmastersun
03-12-2017, 01:52 AM
But when minimize the window size of the Forum .. comes in the background
Is there a way to fit with Style
You should use bzcomputers's way suggested.
Using media screen can help in this case but note that when viewing your banner ads on smaller screens, they can hide a part of your content on right and left side.
yilmaz
03-12-2017, 01:47 PM
Works
But when minimize the window size of the Forum ... It appears on the forums
Demo https://i.hizliresim.com/ldrG7B.gif
Emad ELsayed
03-12-2017, 02:58 PM
Demo https://i.hizliresim.com/ldrG7B.gif
This works great dear
But you can develop it so that it can exclude Forum
Best regards for your cooperation
yilmaz
03-12-2017, 05:14 PM
This works great dear
But you can develop it so that it can exclude Forum
Best regards for your cooperation
added excluded forums
155992
Emad ELsayed
03-12-2017, 07:16 PM
added excluded forums
155992
dear / yilmaz
I can't thank you enough
Thank a lot for the the nice gift
Best Regards
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.