Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var dropdownItemPositionLeft = parseInt( $menuItemDropdown.offset().left ),
- windowWidth = parseInt( jQuery( window ).width() );
- if ( this.elements.$cmsmastersMenuContainer.hasClass( 'cmsmasters_nav_menu_dropdown_position_right' ) ) {
- $menuItemDropdown.css( 'left', '100%' );
- var dropdownItemPosition = parseInt( $menuItemDropdown.width() ) + parseInt( $menuItemDropdown.offset().left );
- if ( windowWidth > dropdownItemPosition ) {
- $menuItemDropdown.css( {
- right: 'auto',
- left: '100%',
- } );
- } else {
- $menuItemDropdown.css( {
- right: '100%',
- left: 'auto',
- } );
- }
- } else {
- if ( 0 < dropdownItemPositionLeft ) {
- $menuItemDropdown.css( {
- left: 'auto',
- right: '100%',
- } );
- } else {
- $menuItemDropdown.css( {
- left: '100%',
- right: 'auto',
- } );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement