Background de acordo com a resolução da tela[RESOLVIDO]

  • lucascatani
  • Avatar de lucascatani Autor do Tópico
  • Offline
  • JCB! Professional
  • JCB! Professional
Mais
14 anos 6 meses atrás #46635 por lucascatani
lucascatani replied the topic: Re: Background de acordo com a resolução da tela[RESOLVIDO]

aroldoschwab escreveu: Amigo... poderia ser mais específico onde você colocou esse código no index.php?
Quando coloco no index aqui aparecem erros de linguagem... por acaso não tem que ter:
<script language="JavaScript">
antes e depois fechando o código no index? ou algo assim?
Agradeço a resposta...

Amigo.. segue o código inteiro do index.php para você tirar suas dúvias
<script type="text/javascript">

function resolucao()
{
if (screen.width == "640"){
   document.body.style.background="#fafafa url(http://localhost/xxxpolenta/templates/mariabenta/images/page_bg800.jpg) no-repeat";
}
if (screen.width == "800"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg800.jpg) no-repeat";
}
if (screen.width == "1152"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1152.jpg) no-repeat";
}
if (screen.width == "1024"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1024.jpg) no-repeat";
}
if (screen.width == "1280"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1280.jpg) no-repeat";
}
if (screen.width == "1440"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1440.jpg) no-repeat";
   }
if (screen.width == "1366"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1366.jpg) no-repeat";
   }   
if (screen.width == "1680"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1680.jpg) no-repeat";
   }
if (screen.width == "1600"){
   document.body.style.background="#fafafa url(templates/mariabenta/images/page_bg1680.jpg) no-repeat";
   }
}

</script>
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
JPlugin::loadLanguage( 'tpl_SG1' );
?>
<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />


<link rel="stylesheet" href="templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<!--&#91;if  IE 8&#93;>
	<style type="text/css">
		#wrapper {display:table;}
	</style>
<!&#91;endif&#93;-->



</head>
<body id="page_bg" onload = "resolucao()">
	<div id="wrapper">
		<div id="header">			
			<div id="pillmenu"><jdoc:include type="modules" name="user3" /></div>
			<div id="search"><jdoc:include type="modules" name="user4" /></div>
			<div class="clr"></div>			
		</div>
		
		<?php if($this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>		
		<div id="content">
		<?php elseif($this->countModules('left') and !$this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
		<div id="content_l">
		<?php elseif(!$this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
		<div id="content_r">
		<?php else: ?>
		<div id="content_full">
		<?php endif; ?>
				
			<?php if($this->countModules('left') and JRequest::getCmd('layout') != 'form') : ?>
			<div id="leftcolumn">
				<jdoc:include type="modules" name="left" style="rounded" />
				<br />
				<?php $sg = 'banner'; include "templates.php"; ?>
				<br />
			</div>
			<?php endif; ?>
			
			<?php if($this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
			<div id="maincolumn">			
			<?php elseif($this->countModules('left') and !$this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
			<div id="maincolumn_left">
			<?php elseif(!$this->countModules('left') and $this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
			<div id="maincolumn_right">
			<?php else: ?>
			<div id="maincolumn_full">
			<?php endif; ?>
			
				<div class="nopad">
					<?php if($this->params->get('showComponent')) : ?>
						<jdoc:include type="component" />
					<?php endif; ?>
				</div>
			</div>
			
			<?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
			<div id="rightcolumn">
				<jdoc:include type="modules" name="right" style="rounded" />
			</div>
			<?php endif; ?>
			<div class="clr"></div>
								
		</div>		
	</div>
	<div id="footer">
				<jdoc:include type="modules" name="debug" />				
	</div>
</body>
</html>

Espero que ajude....

Lucas Catani
[b:1bmpfj72]Blog[/b:1bmpfj72]: <!-- m --><a class="postlink" href=" www.l9web.com.br/blog/ " onclick="window.open(this.href);return false;"> www.l9web.com.br/blog/ </a><!-- m -->
[b:1bmpfj72]MSN:[/b:1bmpfj72] <!-- e --><a href="Este endereço de email está sendo protegido de spambots. Você precisa do JavaScript ativado para vê-lo.">Este endereço de email está sendo protegido de spambots. Você precisa do JavaScript ativado para vê-lo.</a><!-- e -->
[b:1bmpfj72]L9WEB | WEBSITES[/b:1bmpfj72] <!-- m --><a...

Please Entrar ou Registrar to join the conversation.

Mais
14 anos 6 meses atrás #46649 por aroldoschwab
aroldoschwab replied the topic: Re: Background de acordo com a resolução da tela[RESOLVIDO]
Obrigado pela resposta amigo...
Deu certo aqui sim agora...
Valeu
E parabéns pelo código...

Please Entrar ou Registrar to join the conversation.

  • lucascatani
  • Avatar de lucascatani Autor do Tópico
  • Offline
  • JCB! Professional
  • JCB! Professional
Mais
14 anos 6 meses atrás #46758 por lucascatani
lucascatani replied the topic: Re: Background de acordo com a resolução da tela[RESOLVIDO]

aroldoschwab escreveu: Obrigado pela resposta amigo...
Deu certo aqui sim agora...
Valeu
E parabéns pelo código...


Valeu! Grande abraço! <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Chorando ou Muito Triste" /><!-- s:cry: -->

Lucas Catani
[b:1bmpfj72]Blog[/b:1bmpfj72]: <!-- m --><a class="postlink" href=" www.l9web.com.br/blog/ " onclick="window.open(this.href);return false;"> www.l9web.com.br/blog/ </a><!-- m -->
[b:1bmpfj72]MSN:[/b:1bmpfj72] <!-- e --><a href="Este endereço de email está sendo protegido de spambots. Você precisa do JavaScript ativado para vê-lo.">Este endereço de email está sendo protegido de spambots. Você precisa do JavaScript ativado para vê-lo.</a><!-- e -->
[b:1bmpfj72]L9WEB | WEBSITES[/b:1bmpfj72] <!-- m --><a...

Please Entrar ou Registrar to join the conversation.