Jump to content
Fórum Script Brasil
  • 0

Detectar resolução


saboia2000

Question

Bom dia

alguém pode me ajudar no seguinte caso.

Preciso detectar a resolucao do de video, e ultizar o codigo abaixo, mas está dando erro

<script language="JavaScript" type="text/JavaScript">
if(screen.width==800 && screen.height==600){
Não faz nada se for 800x600
} else if (screen.width==1024 && screen.height==768) {
<!--#INCLUDE FILE="lateral_servicos.asp" -->  se for 1024x768
}

</script>

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Bom dia

alguém pode me ajudar no seguinte caso.

Preciso detectar a resolucao do de video, e ultizar o codigo abaixo, mas está dando erro

&lt;script language="JavaScript" type="text/JavaScript">

if(screen.width==800 && screen.height==600){

Não faz nada se for 800x600

} else if (screen.width==1024 && screen.height==768) {

<!--#INCLUDE FILE="lateral_servicos.asp" --> se for 1024x768

}

</script>

Só´faltou o document.write()

<script language="JavaScript" type="text/JavaScript">
if (screen.width==1024 && screen.height==768)
    document.write('<!--#INCLUDE FILE="lateral_servicos.asp" -->');
</script>

Link to comment
Share on other sites

  • 0
Guest --saboia2000 --

Boa noite valeu pela dica mas não deu certo.

<script language="JavaScript" type="text/JavaScript">

if(screen.width==800 && screen.height==600)
{


} 
else if (screen.width==1024 && screen.height==768)
{
document.write=('<!--#INCLUDE FILE="lateral_servicos.asp"-->');
}

</script>

Toda hora vem o erro ("Constante de sequencia não finalizada")

Tentei tirar as chaves, aspas mas não deu certo.

Link to comment
Share on other sites

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
      152k
    • Total Posts
      651.5k
×
×
  • Create New...