Esempio n. 1
0
    function ct_sticky_menu()
    {
        global $ct_options;
        $sticky_menu = stripslashes($ct_options['ct_sticky_menu']);
        $menu_background = stripslashes($ct_options['ct_menu_background']);
        $rgb = ct_hex2rgb($menu_background);
        $rgba = "rgba(" . $rgb[0] . "," . $rgb[1] . "," . $rgb[2] . "," . "0.9)";
        if ($sticky_menu) {
            ?>
			<script type="text/javascript">
			/* <![CDATA[ */
				jQuery.noConflict()(function($){
					$(document).ready(function(){
						var sticky_navigation_offset_top = $('#mainmenu-block-bg').offset().top+0;
						var sticky_navigation = function(){
							var scroll_top = $(window).scrollTop(); // our current vertical position from the top

							if (scroll_top > sticky_navigation_offset_top) { 
								<?php 
            if (!is_admin_bar_showing()) {
                ?>
									$('#mainmenu-block-bg').css({ 'position': 'fixed', 'top':0, 'left':0, 'z-index':11 });
								<?php 
            } else {
                ?>
									$('#mainmenu-block-bg').css({ 'position': 'fixed', 'top':28, 'left':0, 'z-index':11 });
								<?php 
            }
            ?>
							} else {
								$('#mainmenu-block-bg').css({ 'top':0, 'position': 'relative','padding-top':0 }); 
							}  
						};

						// run our function on load
						sticky_navigation();

						// and run it again every time you scroll
						$(window).scroll(function() {
							sticky_navigation();
						});
					});
				});
			/* ]]> */   
			</script>
		<?php 
        }
    }
Esempio n. 2
0
if ($menu_font['style'] == 'bold italic') {
    ?>
		font-weight: bold;
		font-style: italic;
	<?php 
}
?>
}
.current-menu-item > a, .current-menu-ancestor > a, .current-post-ancestor > a { color: <?php 
echo $links_color;
?>
 !important; }

<?php 
// convert hex color too rgb
$rgb = ct_hex2rgb($dd_menu_background);
$rgba = "rgba(" . $rgb[0] . "," . $rgb[1] . "," . $rgb[2] . ", " . $dd_menu_opacity . ")";
?>
.sf-menu > li > ul, .sf-menu ul li ul, .sf-menu ul li {
	background: <?php 
echo $dd_menu_background;
?>
;
	background: <?php 
echo $rgba;
?>
;
}
.sf-menu ul > li:hover { background: <?php 
echo $dd_menu_hover_background;
?>