From ca72d485667a401dd9b873745313da0b7aa5d622 Mon Sep 17 00:00:00 2001 From: lh_wang Date: Tue, 4 Aug 2015 13:32:02 +0800 Subject: [PATCH] add display none --- lvtu/index.html | 4 ++-- lvtu/js/main.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lvtu/index.html b/lvtu/index.html index b08af25..716e7c9 100644 --- a/lvtu/index.html +++ b/lvtu/index.html @@ -81,7 +81,7 @@
-
+
@@ -97,7 +97,7 @@ diff --git a/lvtu/js/main.js b/lvtu/js/main.js index 97b0653..ce03825 100644 --- a/lvtu/js/main.js +++ b/lvtu/js/main.js @@ -254,17 +254,17 @@ } //开启、关闭弹幕 - var tag = 0; $('.danmu').on('click', function(){ - if(tag % 2 === 0){ + $('#toupiao_frame').hide(); + if($('#tanmu_div').css('display') === 'none' || parseInt($('#tanmu_div').css('top')) < 0){ $('#tanmu_div').fadeIn(); $('#tanmu_div').css('right', '79px'); $('#tanmu_div').css('top', '70px'); $('#tanmu_div').css('visibility', 'visible'); }else{ + $('#tanmu_div').fadeOut(); } - tag ++; }); //获取小车的位置 @@ -549,14 +549,13 @@ } //开启、关闭投票 - var tou_tag = 0; $('.toupiao').on('click', function(){ - if(tou_tag % 2 === 0){ - $('#toupiao_frame').fadeIn(); - }else{ + $('#tanmu_div').hide(); + if($('#toupiao_frame').css('display') !== 'none'){ $('#toupiao_frame').fadeOut(); + }else{ + $('#toupiao_frame').fadeIn(); } - tou_tag ++; }); @@ -633,4 +632,5 @@ }, 1000); } + })(window, $);