123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- $(document).ready( function() {
- $('nav#primary-navigation .nav-menu > li').hover( function() {
- if ( $(this).has('.sub-menu').length ) {
- $('.sub-nav-back').addClass('show');
- }
- },
- function() {
- $('.sub-nav-back').removeClass('show');
- });
-
-
- });
- $(window).load( function() {
- $('#slider').nivoSlider({
- directionNav: false,
- controlNav: false,
- });
- });
- $(function () {
- $("#menu-primary-menu").tinyNav(
- {
- active: 'selected', // String: Set the "active" class
- header: 'Navigation', // String: Specify text for "header" and show header instead of the active item
- indent: '- ', // String: Specify text for indenting sub-items
- label: '' // String: Sets the <label> text for the <select> (if not set, no label will be added)
- }
- );
- });
- /*! http://tinynav.viljamis.com v1.2 by @viljamis */
- (function ($, window, i) {
- $.fn.tinyNav = function (options) {
- // Default settings
- var settings = $.extend({
- 'active' : 'selected', // String: Set the "active" class
- 'header' : '', // String: Specify text for "header" and show header instead of the active item
- 'indent' : '- ', // String: Specify text for indenting sub-items
- 'label' : '' // String: sets the <label> text for the <select> (if not set, no label will be added)
- }, options);
- return this.each(function () {
- // Used for namespacing
- i++;
- var $nav = $(this),
- // Namespacing
- namespace = 'tinynav',
- namespace_i = namespace + i,
- l_namespace_i = '.l_' + namespace_i,
- $select = $('<select/>').attr("id", namespace_i).addClass(namespace + ' ' + namespace_i);
- if ($nav.is('ul,ol')) {
- if (settings.header !== '') {
- $select.append(
- $('<option/>').text(settings.header)
- );
- }
- // Build options
- var options = '';
- $nav
- .addClass('l_' + namespace_i)
- .find('a')
- .each(function () {
- options += '<option value="' + $(this).attr('href') + '">';
- var j;
- for (j = 0; j < $(this).parents('ul, ol').length - 1; j++) {
- options += settings.indent;
- }
- options += $(this).text() + '</option>';
- });
- // Append options into a select
- $select.append(options);
- // Select the active item
- if (!settings.header) {
- $select
- .find(':eq(' + $(l_namespace_i + ' li')
- .index($(l_namespace_i + ' li.' + settings.active)) + ')')
- .attr('selected', true);
- }
- // Change window location
- $select.change(function () {
- window.location.href = $(this).val();
- });
- // Inject select
- $(l_namespace_i).after($select);
- // Inject label
- if (settings.label) {
- $select.before(
- $("<label/>")
- .attr("for", namespace_i)
- .addClass(namespace + '_label ' + namespace_i + '_label')
- .append(settings.label)
- );
- }
- }
- });
- };
- })(jQuery, this, 0);
|