vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How add floating ads in left and right vb4 (https://vborg.vbsupport.ru/showthread.php?t=324686)

Emad ELsayed 03-11-2017 01:50 PM

How add floating ads in left and right vb4
 
welcome everybody
How add floating ads in left and right vb4 ?
This code works
PHP Code:

<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 0px;"Google AdSense Code </div

PHP Code:

<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/showthrea...99#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.

Code:

@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

1 Attachment(s)
Would it be this product?

Screenshot
Attachment 155989

Emad ELsayed 03-11-2017 06:50 PM

Quote:

Originally Posted by KevinL (Post 2583677)

Dear Sorry it did not work 4.2.4


Quote:

Originally Posted by bzcomputers (Post 2583680)
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.

Code:

@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

Quote:

Originally Posted by yilmaz (Post 2583681)
Would it be this product?

Screenshot
Attachment 155989

Works
But when minimize the window size of the Forum ... It appears on the forums

webmastersun 03-12-2017 01:52 AM

Quote:

Originally Posted by Emad ELsayed (Post 2583674)
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

1 Attachment(s)
Quote:

Originally Posted by Emad ELsayed (Post 2583700)
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

Quote:

Originally Posted by yilmaz (Post 2583727)

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

1 Attachment(s)
Quote:

Originally Posted by Emad ELsayed (Post 2583731)
This works great dear
But you can develop it so that it can exclude Forum
Best regards for your cooperation

added excluded forums

Attachment 155992

Emad ELsayed 03-12-2017 07:16 PM

Quote:

Originally Posted by yilmaz (Post 2583743)
added excluded forums

Attachment 155992

dear / yilmaz
I can't thank you enough
Thank a lot for the the nice gift
Best Regards


All times are GMT. The time now is 04:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03121 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete