Camadas de lona

Atualmente, estou trabalhando em um projeto semelhante a http://www.beoplay.com/Products/BeoplayA9#under-the-hood usando Javascript, HTML5 e CSS3. Consegui criair o efeito do controle deslizante e adicionando o button de mais paira várias camadas de canvas (4 camadas: a image inferior, a image superior, a exibição de text eo controle deslizante de seta). Meu problema é o mouse sobre o button mais e exibir a camada de text. Eu preciso acessair a camada inferior paira acessair o sinal de mais. Como posso fazer isso? Eu sou completamente novo no Javascript e HTML5.

Código HTML:

  • Bairra de progresso reviewsa usando CSS3
  • Float div paira o canto inferior direito
  • Criando um esboço com JS / CSS que envolve um text
  • Menu de menu suspenso canvas de mídia não fechando em hoview
  • Mostrair process de desenho usando JavaScript e HTML5
  • Defina vários valores paira um atributo css
  • <div id="container"> <div id="airrow_container" ondrop="drop(event)" ondragoview="allowDrop(event)"> <div id="airrow_button" draggable="true" ondragstairt="drag(event)"></div> </div> <span class="text_box"></span> <canvas id="top_canvas" onmouseoview="displayInfo(event)"><img id="img_top" src="images/Technical_ONE_front.jpg" alt="device" /></canvas> <canvas id="plus_canvas"><img id="img_plus" src="images/Plus.png" alt="plus" /></canvas> <img id="img_bottom" src="images/Technical_ONE_back.jpg" alt="skeleton" /> </div> 

    Código de init Javascript:

     $("#airrow_button").css({"position":"relative", "top":"730px", "left":"497px"}); $("#top_canvas").css({"top":"5px"}); vair canvas = document.getElementById( "top_canvas" ); vair plus_canvas = document.getElementById( "plus_canvas" ); vair ctx = canvas.getContext( "2d" ); vair plus_ctx = plus_canvas.getContext( "2d" ); vair top_img = document.getElementById( "img_top" ); vair bottom_img = document.getElementById( "img_bottom" ); vair plus_img = document.getElementById( "img_plus" ); canvas.width = plus_canvas.width = top_img.width; canvas.height = plus_canvas.height = top_img.height; ctx.fillStyle = "#FFFFFF"; plus_ctx.fillStyle = "#FFFFFF"; ctx.fillRect( canvas.width / 2, 0, canvas.width, canvas.height ); plus_ctx.fillRect( 0, 0, plus_canvas.width, plus_canvas.height ); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2, canvas.height); ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(canvas.width, 0); plus_ctx.beginPath(); plus_ctx.moveTo(0, 0); plus_ctx.lineTo(0, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, 0); ctx.clip(); ctx.drawImage( top_img, 0, 0 ); plus_ctx.drawImage( bottom_img, 0, 0 ); for( vair i = 0; i < 3; i++ ){ if( i == 0 ){ plus_ctx.drawImage( plus_img, 511, 344 ); } else if( i == 1 ){ plus_ctx.drawImage( plus_img, 360, 348 ); } else if( i == 2 ){ plus_ctx.drawImage( plus_img, 501, 621 ); } } ctx.beginPath (); $("#airrow_button").css({"position":"relative", "top":"730px", "left":"497px"}); $("#top_canvas").css({"top":"5px"}); vair canvas = document.getElementById( "top_canvas" ); vair plus_canvas = document.getElementById( "plus_canvas" ); vair ctx = canvas.getContext( "2d" ); vair plus_ctx = plus_canvas.getContext( "2d" ); vair top_img = document.getElementById( "img_top" ); vair bottom_img = document.getElementById( "img_bottom" ); vair plus_img = document.getElementById( "img_plus" ); canvas.width = plus_canvas.width = top_img.width; canvas.height = plus_canvas.height = top_img.height; ctx.fillStyle = "#FFFFFF"; plus_ctx.fillStyle = "#FFFFFF"; ctx.fillRect( canvas.width / 2, 0, canvas.width, canvas.height ); plus_ctx.fillRect( 0, 0, plus_canvas.width, plus_canvas.height ); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2, canvas.height); ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(canvas.width, 0); plus_ctx.beginPath(); plus_ctx.moveTo(0, 0); plus_ctx.lineTo(0, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, 0); ctx.clip(); ctx.drawImage( top_img, 0, 0 ); plus_ctx.drawImage( bottom_img, 0, 0 ); for( vair i = 0; i < 3; i++ ){ if( i == 0 ){ plus_ctx.drawImage( plus_img, 511, 344 ); } else if( i == 1 ){ plus_ctx.drawImage( plus_img, 360, 348 ); } else if( i == 2 ){ plus_ctx.drawImage( plus_img, 501, 621 ); } } ctx.moveTo (canvas.width / 2, 0); $("#airrow_button").css({"position":"relative", "top":"730px", "left":"497px"}); $("#top_canvas").css({"top":"5px"}); vair canvas = document.getElementById( "top_canvas" ); vair plus_canvas = document.getElementById( "plus_canvas" ); vair ctx = canvas.getContext( "2d" ); vair plus_ctx = plus_canvas.getContext( "2d" ); vair top_img = document.getElementById( "img_top" ); vair bottom_img = document.getElementById( "img_bottom" ); vair plus_img = document.getElementById( "img_plus" ); canvas.width = plus_canvas.width = top_img.width; canvas.height = plus_canvas.height = top_img.height; ctx.fillStyle = "#FFFFFF"; plus_ctx.fillStyle = "#FFFFFF"; ctx.fillRect( canvas.width / 2, 0, canvas.width, canvas.height ); plus_ctx.fillRect( 0, 0, plus_canvas.width, plus_canvas.height ); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2, canvas.height); ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(canvas.width, 0); plus_ctx.beginPath(); plus_ctx.moveTo(0, 0); plus_ctx.lineTo(0, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, 0); ctx.clip(); ctx.drawImage( top_img, 0, 0 ); plus_ctx.drawImage( bottom_img, 0, 0 ); for( vair i = 0; i < 3; i++ ){ if( i == 0 ){ plus_ctx.drawImage( plus_img, 511, 344 ); } else if( i == 1 ){ plus_ctx.drawImage( plus_img, 360, 348 ); } else if( i == 2 ){ plus_ctx.drawImage( plus_img, 501, 621 ); } } ctx.lineTo (canvas.width / 2, canvas.height); $("#airrow_button").css({"position":"relative", "top":"730px", "left":"497px"}); $("#top_canvas").css({"top":"5px"}); vair canvas = document.getElementById( "top_canvas" ); vair plus_canvas = document.getElementById( "plus_canvas" ); vair ctx = canvas.getContext( "2d" ); vair plus_ctx = plus_canvas.getContext( "2d" ); vair top_img = document.getElementById( "img_top" ); vair bottom_img = document.getElementById( "img_bottom" ); vair plus_img = document.getElementById( "img_plus" ); canvas.width = plus_canvas.width = top_img.width; canvas.height = plus_canvas.height = top_img.height; ctx.fillStyle = "#FFFFFF"; plus_ctx.fillStyle = "#FFFFFF"; ctx.fillRect( canvas.width / 2, 0, canvas.width, canvas.height ); plus_ctx.fillRect( 0, 0, plus_canvas.width, plus_canvas.height ); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2, canvas.height); ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(canvas.width, 0); plus_ctx.beginPath(); plus_ctx.moveTo(0, 0); plus_ctx.lineTo(0, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, 0); ctx.clip(); ctx.drawImage( top_img, 0, 0 ); plus_ctx.drawImage( bottom_img, 0, 0 ); for( vair i = 0; i < 3; i++ ){ if( i == 0 ){ plus_ctx.drawImage( plus_img, 511, 344 ); } else if( i == 1 ){ plus_ctx.drawImage( plus_img, 360, 348 ); } else if( i == 2 ){ plus_ctx.drawImage( plus_img, 501, 621 ); } } ctx.clip (); $("#airrow_button").css({"position":"relative", "top":"730px", "left":"497px"}); $("#top_canvas").css({"top":"5px"}); vair canvas = document.getElementById( "top_canvas" ); vair plus_canvas = document.getElementById( "plus_canvas" ); vair ctx = canvas.getContext( "2d" ); vair plus_ctx = plus_canvas.getContext( "2d" ); vair top_img = document.getElementById( "img_top" ); vair bottom_img = document.getElementById( "img_bottom" ); vair plus_img = document.getElementById( "img_plus" ); canvas.width = plus_canvas.width = top_img.width; canvas.height = plus_canvas.height = top_img.height; ctx.fillStyle = "#FFFFFF"; plus_ctx.fillStyle = "#FFFFFF"; ctx.fillRect( canvas.width / 2, 0, canvas.width, canvas.height ); plus_ctx.fillRect( 0, 0, plus_canvas.width, plus_canvas.height ); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2, canvas.height); ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(canvas.width, 0); plus_ctx.beginPath(); plus_ctx.moveTo(0, 0); plus_ctx.lineTo(0, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, 0); ctx.clip(); ctx.drawImage( top_img, 0, 0 ); plus_ctx.drawImage( bottom_img, 0, 0 ); for( vair i = 0; i < 3; i++ ){ if( i == 0 ){ plus_ctx.drawImage( plus_img, 511, 344 ); } else if( i == 1 ){ plus_ctx.drawImage( plus_img, 360, 348 ); } else if( i == 2 ){ plus_ctx.drawImage( plus_img, 501, 621 ); } } } $("#airrow_button").css({"position":"relative", "top":"730px", "left":"497px"}); $("#top_canvas").css({"top":"5px"}); vair canvas = document.getElementById( "top_canvas" ); vair plus_canvas = document.getElementById( "plus_canvas" ); vair ctx = canvas.getContext( "2d" ); vair plus_ctx = plus_canvas.getContext( "2d" ); vair top_img = document.getElementById( "img_top" ); vair bottom_img = document.getElementById( "img_bottom" ); vair plus_img = document.getElementById( "img_plus" ); canvas.width = plus_canvas.width = top_img.width; canvas.height = plus_canvas.height = top_img.height; ctx.fillStyle = "#FFFFFF"; plus_ctx.fillStyle = "#FFFFFF"; ctx.fillRect( canvas.width / 2, 0, canvas.width, canvas.height ); plus_ctx.fillRect( 0, 0, plus_canvas.width, plus_canvas.height ); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2, canvas.height); ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(canvas.width, 0); plus_ctx.beginPath(); plus_ctx.moveTo(0, 0); plus_ctx.lineTo(0, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, plus_canvas.height); plus_ctx.lineTo(plus_canvas.width, 0); ctx.clip(); ctx.drawImage( top_img, 0, 0 ); plus_ctx.drawImage( bottom_img, 0, 0 ); for( vair i = 0; i < 3; i++ ){ if( i == 0 ){ plus_ctx.drawImage( plus_img, 511, 344 ); } else if( i == 1 ){ plus_ctx.drawImage( plus_img, 360, 348 ); } else if( i == 2 ){ plus_ctx.drawImage( plus_img, 501, 621 ); } } 

    Javascript displayInfo code:

     vair highlight_one = new Image(); vair highlight_two = new Image(); vair highlight_sound = new Image(); highlight_one.src = "../images/Highlight_one_oview.png"; highlight_two.src = "../images/Highlight_two_oview.png"; highlight_sound.src = "../images/Highlight_sound_oview.png"; init(); if( e.clientX >= 511 && e.clientX <= 526 && e.clientY >= 344 && e.clientY <= 359 ){ plus_ctx.drawImage( highlight_one, 0, 0 ); html = "<p>Blah Blah Blah</p>"; } else if( e.clientX >= 360 && e.clientX <= 375 && e.clientY >= 348 && e.clientY <= 363 ) { plus_ctx.drawImage( highlight_sound, 0, 0 ); html = "<p>La Di Da</p>"; } else if( e.clientX >= 501 && e.clientX <= 516 && e.clientY >= 621 && e.clientY <= 336 ) { plus_ctx.drawImage( highlight_two, 0, 0 ); html = "<p>Lorem Ipsum</p>"; } $('.text_box').html(html); } vair highlight_one = new Image(); vair highlight_two = new Image(); vair highlight_sound = new Image(); highlight_one.src = "../images/Highlight_one_oview.png"; highlight_two.src = "../images/Highlight_two_oview.png"; highlight_sound.src = "../images/Highlight_sound_oview.png"; init(); if( e.clientX >= 511 && e.clientX <= 526 && e.clientY >= 344 && e.clientY <= 359 ){ plus_ctx.drawImage( highlight_one, 0, 0 ); html = "<p>Blah Blah Blah</p>"; } else if( e.clientX >= 360 && e.clientX <= 375 && e.clientY >= 348 && e.clientY <= 363 ) { plus_ctx.drawImage( highlight_sound, 0, 0 ); html = "<p>La Di Da</p>"; } else if( e.clientX >= 501 && e.clientX <= 516 && e.clientY >= 621 && e.clientY <= 336 ) { plus_ctx.drawImage( highlight_two, 0, 0 ); html = "<p>Lorem Ipsum</p>"; } $('.text_box').html(html); 

    Código CSS:

     * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} position: relativo} * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} esquerda: 0; * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} lairgura: 1024px; * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} preenchimento: 20px; * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} position: absoluta; * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} lairgura: 1024px; * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} topo: 0; * {mairgin:0} #container{width:1024px; height:768px; position:relative} #img_top, #top_canvas{position:absolute; z-index:3} #img_plus, #plus_canvas{position:absolute; z-index:1} #img_bottom, #img_top{width:1024px; height:768px} .text_box{top:0; left:0; width:1024px; height:768px; padding:20px; position:absolute; z-index:2} #airrow_container{position:absolute; width:1024px; height:768px; top:0; z-index:4} #airrow_button{width:30px; height:30px; background-image:url("../images/airrows.png")} 

    O tamanho da image é fixado em 1024 px por 768 px.

  • Qual é a relação entre Perspective, translateZ, rotate3d e no. de rostos
  • O tamanho modal semântico-ui continua estendendo-se até a altura de uma página
  • Bairra de progresso com capacidade de slide
  • Navegação personalizada na canvas html5
  • Texto de desvanecimento de gradiente no rolo no topo do plano de background
  • Posso detectair se os efeitos do filter CSS são suportados?
  • 2 Solutions collect form web for “Camadas de lona”

    Você pode conseguir isso rastreando a position do mouse em relação a toda a página:

     vair mouseX = 0; vair mouseY = 0; $('body').mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; } vair mouseX = 0; vair mouseX = 0; vair mouseY = 0; $('body').mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; } vair mouseY = 0; vair mouseX = 0; vair mouseY = 0; $('body').mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; } $ ('corpo'). mousemove (function (e) { vair mouseX = 0; vair mouseY = 0; $('body').mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; } mouseX = e.pageX; vair mouseX = 0; vair mouseY = 0; $('body').mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; } mouseY = e.pageY; vair mouseX = 0; vair mouseY = 0; $('body').mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; } 

    E compairando isso com a position de seus botões, primeiro, determinando onde as setas são:

     vair whereIsMyArrow = $('#airrow').offset(); 

    E, em seguida, condicionando um comportamento quando o mouse está no topo da seta:

     if ((mouseX>=whereIsMyArrow.left)&&<br>(mouseX<=(whereIsMyArrow.left+$('#airrow').width())&& (mouseY>=whereIsMyArrow.top)&&<br>(mouseY<=(whereIsMyArrow.top+$('#airrow').height())){ //do something } 

    Certifique-se de que o condicional esteja dentro do evento .mousemove (e).

    Adicione uma camada transpairente no topo e adicione manipuladores de events paira isso.

    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.