/** * Title: Custom Theme JS * * Description: Defines custom JS for this theme. * * Please do not edit this file. This file is part of the Cyber Chimps Framework and all modifications * should be made in a child theme. * * @category Cyber Chimps Framework * @package Framework * @since 1.0 * @author CyberChimps * @license http://web.archive.orghttp://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) * @link http://web.archive.orghttp://www.cyberchimps.com/ */ /* Start of script for image uploader */ jQuery(document).ready(function() { jQuery(window).bind("load", function() { var body_width = jQuery('body').width(); var height = jQuery('#header_nav_container').height(); var width = jQuery('.main-navigation .nav > li.current_page_item').width(); width = (width != undefined || width) ? width : jQuery('.main-navigation .nav > li.current-menu-ancestor').width(); var padding = Math.round(height * (40/100)); var newheight = height - padding; var color = jQuery('.main-navigation .nav > li.current_page_item').css('background-color'); color = (color != undefined || color) ? color : jQuery('.main-navigation .nav > li.current-menu-ancestor').css('background-color'); if(body_width > 979){ jQuery('.main-navigation .nav > li.current_page_item > a, .main-navigation .nav > li.current-menu-ancestor > a').append(''); jQuery('.main-navigation .nav > li > a > .menu-pointer').css({ 'position' : 'absolute', 'top' : '100%', 'left' : 0, 'display' : 'inline-block', 'border-top' : '10px solid ' + color, 'border-right' : width/2 + 'px solid transparent', 'border-left' : width/2 + 'px solid transparent', 'content' : '' }); jQuery('.main-navigation .nav > li > a').animate({ 'padding-top': padding + 'px', height: newheight + 'px' }, 500); } }); });