Jump to content
Fórum Script Brasil
  • 0

Tentando Mvc!



ola tenho seguinte codigo separado por html , css, js


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="musical.css" />
<script type="text/javascript" src="musical.js"></script>
<script type="text/jscript">

<div id="keyboard" class="musicalKeys">
    <div class="do musicalButton"></div>
    <div class="re musicalButton"></div>
    <div class="mi musicalButton"></div>
    <div class="fa musicalButton"></div>
    <div class="so musicalButton"></div>
    <div class="la musicalButton"></div>
    <div class="si musicalButton"></div>
    <div class="do musicalButton"></div>
<div id="console" class="console"></div>
// JavaScript Document
function assignKeys(){
    var keyboard=document.getElementById("keyboard");
    var keys = document.getElementsByTagName("div");
        for( var i=0;i<keys.length;i++){
            var key=keys[i];
            var classes = (key.className).split(" ");
            if( classes && classes.length>=2 && classes[1] == "musicalButton"){
                var note = classes[0];
                key.note = note;
                key.onmouseover = playNote;

function playNote(event){
    var note = this.note;
    var console = document.getElementById("console");
    if(note && console){
        console.innerHTML+= note+" . ";
/* CSS Document */

    border: solid maroon 2px;
    width: 536px;
    height: 68px;
    top: 24px;
    left: 24px;
    margin:4 px;
    position: absolute;

    border: solid nacy 1px;
    width: 60px;
    height: 60px;
    margin: 2px;
    float: left;

.do{ background-color:#FF0000;}
.re{ background-color:#FFCC00;}
.mi{ background-color:#FFFF00;}
.fa{ background-color:#00FF00;}
.so{ background-color:#0000FF;}
.la{ background-color: indigo;}
.si{ background-color:#9900FF;}

    font-family:Arial, Helvetica;
    border: solid navy 2px;
    width: 536px;
    height: 320px;
    top: 106px;
    left: 24px;
    margin: 4px;
    position: absolute;

revisei todo o codigo html e js mas não consegui achar o erro.

quando o mouse passar por cima das cores no tela embaixo deveria aparecer uma nota , mas não esta funcionado.

se alguém conseguir fazer funcionar, agradeco

obs: codigo tirado do livro ajax em ação

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...