Advertisement
EduardET

Untitled

Jun 25th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         function bannerPosition( el, pos ) {
  5.             var banner_width = el.outerWidth(),
  6.                 banner_height = el.height();
  7.             if ( pos == 'left' ) {
  8.                 el.css( {
  9.                     'left': ( ( $( window ).width() - $( '.et_pb_column_0' ).width() ) / 2 ) - banner_width - 10,
  10.                 } )
  11.             }
  12.             if ( pos == 'right' ) {
  13.                 el.css( {
  14.                     'right': ( ( $( window ).width() - $( '.et_pb_column_0' ).width() ) / 2 ) - banner_width - 10,
  15.                 } )
  16.             }
  17.  
  18.         }
  19.         setTimeout( function() {
  20.             bannerPosition( $( '.wpc-banner-left' ), 'left' );
  21.             bannerPosition( $( '.wpc-banner-right' ), 'right' );
  22.         }, 100 );
  23.  
  24.     } );
  25. } )( jQuery );
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement