Browse Source

fix music

windhamdavid 10 years ago
parent
commit
217a74a0fd
3 changed files with 32 additions and 8 deletions
  1. 3 5
      functions.php
  2. 27 1
      js/fm.js
  3. 2 2
      style.css

+ 3 - 5
functions.php

@@ -68,11 +68,9 @@ function dw_scripts() {
 	}
 	
 	elseif ( is_page('music') ) {
-		wp_enqueue_script( 'script-o', get_template_directory_uri() . '/js/script-o.js', 'jquery', '', true );
-		//wp_enqueue_script( 'script-o-min', get_template_directory_uri() . '/js/script-o.min.js', 'jquery', '', true );
-		wp_enqueue_script( 'init-o', get_template_directory_uri() . '/js/init-o.js', 'jquery', '', true );
-		//wp_enqueue_script( 'init-o-min', get_template_directory_uri() . '/js/init-o.min.js', 'jquery', '', true );
-		wp_enqueue_script( 'jplayer', get_template_directory_uri() . '/js/amp.min.js', 'jquery', '', true );
+		//wp_enqueue_script( 'script-o', get_template_directory_uri() . '/js/script-o.js', 'jquery', '', true );
+		wp_enqueue_script( 'script-o-min', get_template_directory_uri() . '/js/script-o.min.js', 'jquery', '', true );
+		wp_enqueue_script( 'amp', get_template_directory_uri() . '/js/amp.min.js', 'jquery', '', true );
 		wp_enqueue_script( 'chart', get_template_directory_uri() . '/js/chart.min.js', 'jquery', '', true );
 		wp_enqueue_script( 'last-fm', get_template_directory_uri() . '/js/fm.js', 'jquery', '', true );
 	}

+ 27 - 1
js/fm.js

@@ -620,4 +620,30 @@ function radioTitle() {
 $(document).ready(function () {
     setTimeout(function () {radioTitle();}, 2000);
     setInterval(function () {radioTitle();}, 30000); // update every 30 seconds
-});	
+});
+
+$('.nav-toggle').on('touchstart click', function(e) {
+	e.preventDefault();
+	$( this ).toggleClass( 'active' );
+});
+
+$(function dw_hidenav() {
+	var headerHeight = $('.navbar').height();
+	$(window).on('scroll', { previousTop: 0 },
+		function() {
+		var currentTop = $(window).scrollTop();
+		if (currentTop < this.previousTop) {
+			if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
+					$('.navbar').addClass('visible');
+				} else {
+					$('.navbar').removeClass('visible fixed');
+				}
+		} 
+		else {
+			$('.navbar').removeClass('visible');
+			if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
+		}
+		this.previousTop = currentTop;
+		}  
+	);
+});

+ 2 - 2
style.css

@@ -2250,11 +2250,11 @@ div#player{
 	font-weight: 400;
 }
 .amplitude-paused{
-	background-image: url('../img/small-gray-play.png');
+	background-image: url('img/small-gray-play.png');
 	background-repeat: no-repeat;
 }
 .amplitude-playing{
-	background-image: url('../img/small-gray-pause.png');
+	background-image: url('img/small-gray-pause.png');
 	background-repeat: no-repeat;
 }
 #amplitude-now-playing-name{