Jump to content
Fórum Script Brasil
  • 0

Mudar Class do css com javascript


rafael luiz

Question

Ola pessoal estou com um problema no meu javascript

estou tentando fazer o java mudar a class do css e assim mudar a cor do fundo e da fonte

do meu blog.

aki meu blog pra vocês darem uma olhada.

http://underworldbook.blogspot.com/

apenas não esta funcionando como deveria... fiz teste em um arquivo html qualquer e funcionou. =/

aki da o comando

<head>
<style type="text/css">
.date-outer {
position: relative;
margin: 30px 0 20px;
padding: 0 15px;
background-color: #141414;
color:#FFF;
border: 1px solid #222;
-moz-box-shadow: 0 0 0 rgba(0, 0, 0, .2);
-webkit-box-shadow: 0 0 0 rgba(0, 0, 0, .2);
-goog-ms-box-shadow: 0 0 0 rgba(0, 0, 0, .2);
box-shadow: 0 0 0 rgba(0, 0, 0, .2);
-moz-border-radius: 0;
-webkit-border-radius: 0;
-goog-ms-border-radius: 0;
border-radius: 0;
border-image: initial;
}

.date-outer2 {
position: relative;
margin: 30px 0 20px;
padding: 0 15px;
background-color: #FFFFFF;
color:#141414;
border: 1px solid #222;
-moz-box-shadow: 0 0 0 rgba(0, 0, 0, .2);
-webkit-box-shadow: 0 0 0 rgba(0, 0, 0, .2);
-goog-ms-box-shadow: 0 0 0 rgba(0, 0, 0, .2);
box-shadow: 0 0 0 rgba(0, 0, 0, .2);
-moz-border-radius: 0;
-webkit-border-radius: 0;
-goog-ms-border-radius: 0;
border-radius: 0;
border-image: initial;
}
</style>
&lt;script language="JavaScript" type="text/javascript">
<!--
function muda(){
    classe = document.getElementById('tst').className; 
    if(classe == 'date-outer2'){
       document.getElementById('tst').className = 'date-outer';
   }else{
       document.getElementById('tst').className = 'date-outer2';
   }
}
//-->
</script>
</head>
<div class="date-outer" id="tst" />
Area de Postagem do Blog.
<input href="java script:function:muda();" name="tst" onclick="muda()" style="background:url(https://sites.google.com/site/gurpshexagono1/coropost.png) no-repeat; background-position:center; border:none; height:20px; width:40px; float: right; margin: 0 5px 5px 0;" type="button" value="">

Minha duvida seria praticamente se falta algo no java e ou onde colocar cada linha de comando.

Como disse funciona em se testado em um arquivo html normal... mas quando coloco no blog não funciona mais.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
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
      152.2k
    • Total Posts
      652k
×
×
  • Create New...