Difference between revisions of "Team:Tianjin/js/maskAddText"

(Blanked the page)
 
Line 1: Line 1:
$(document).ready(function(){
 
maskMouseOver();
 
});
 
function maskMouseOver(){
 
var QAQ="I don't want to write like this, but if I use 'for', there is always something wrong.Excuse me."
 
var mask1 =$('a.mask1');
 
var text1 = $('div.text1');
 
mask1.on('click',function(event){
 
event.preventDefault();
 
text1.css({'visibility':'visible','display':''});
 
$('div.textChange').addClass('textAnimation');
 
$(document).bind('mousewheel', function(event, delta) { return false; });
 
});
 
($('div.textChange')||$('div.row')).on('click',function(event){
 
/*if($(event.target).is('.textChange')){*/
 
event.preventDefault();
 
/*$(this)*/text1.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
/*}*/
 
});
 
$(document).keyup(function(event){
 
if (event.which=='27') {
 
text1.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
  
    var mask2 =$('a.mask2');
 
var text2 = $('div.text2');
 
mask2.on('click',function(event){
 
event.preventDefault();
 
text2.css({'visibility':'visible','display':''});
 
$('div.textChange').addClass('textAnimation');
 
$(document).bind('mousewheel', function(event, delta) { return false; });
 
});
 
text2.on('click',function(event){
 
if($(event.target).is('.texta')){
 
event.preventDefault();
 
$(this).css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
$(document).keyup(function(event){
 
if (event.which=='27') {
 
text2.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
 
var mask3 =$('a.mask3');
 
var text3 = $('div.text3');
 
mask3.on('click',function(event){
 
event.preventDefault();
 
text3.css({'visibility':'visible','display':''});
 
$('div.textChange').addClass('textAnimation');
 
$(document).bind('mousewheel', function(event, delta) { return false; });
 
});
 
text3.on('click',function(event){
 
if($(event.target).is('.texta')){
 
event.preventDefault();
 
$(this).css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
$(document).keyup(function(event){
 
if (event.which=='27') {
 
text3.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
 
var mask4 =$('a.mask4');
 
var text4 = $('div.text4');
 
mask4.on('click',function(event){
 
event.preventDefault();
 
text4.css({'visibility':'visible','display':''});
 
$('div.textChange').addClass('textAnimation');
 
$(document).bind('mousewheel', function(event, delta) { return false; });
 
});
 
text4.on('click',function(event){
 
if($(event.target).is('.texta')){
 
event.preventDefault();
 
$(this).css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
$(document).keyup(function(event){
 
if (event.which=='27') {
 
text4.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
 
var mask5 =$('a.mask5');
 
var text5 = $('div.text5');
 
mask5.on('click',function(event){
 
event.preventDefault();
 
text5.css({'visibility':'visible','display':''});
 
$('div.textChange').addClass('textAnimation');
 
$(document).bind('mousewheel', function(event, delta) { return false; });
 
});
 
text5.on('click',function(event){
 
if($(event.target).is('.texta')){
 
event.preventDefault();
 
$(this).css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
$(document).keyup(function(event){
 
if (event.which=='27') {
 
text5.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
 
var mask6 =$('a.mask6');
 
var text6 = $('div.text6');
 
mask6.on('click',function(event){
 
event.preventDefault();
 
text6.css({'visibility':'visible','display':''});
 
$('div.textChange').addClass('textAnimation');
 
$(document).bind('mousewheel', function(event, delta) { return false; });
 
});
 
text6.on('click',function(event){
 
if($(event.target).is('.texta')){
 
event.preventDefault();
 
$(this).css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
$(document).keyup(function(event){
 
if (event.which=='27') {
 
text6.css({'visibility':'hidden','display':'none'});
 
$('div.textChange').removeClass('textAnimation');
 
$(document).unbind('mousewheel');
 
}
 
});
 
 
}
 

Latest revision as of 07:42, 5 August 2018