Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

NishZ

Content não redimensiona

Recommended Posts

Ola,

 

Eu criei um script que trata da altura da div principal do site a fim dela sempre permanecer fullscreen.

 

Porém ao redimensionar a página a div não redimensiona, só faz esse redimensionamento ao atualizar a página.

 

E eu já revirei o script e não consegui encontrar uma solução...

 

 

Aqui é o trecho do código que eu montei:

    $(function () {
        $(window).bind("load resize", function() {
            var classContent = $("#content").attr("class");
            var bodyHeight = $(window).height();
            var headerHeight = $("#header").height();
            var footerHeight = $("#footer").height();
            var contentWidth = $(window).innerWidth();
            var contHeight = $("#content").height();
            var contentHeight = bodyHeight - headerHeight - footerHeight - 4;
            var contentHeight2 = bodyHeight - footerHeight - 4;
            if((contHeight < contentHeight)){
            	$("#mario4").css("height",contentHeight);
		$("html").css("overflow","hidden");
            }else if((classContent === 'index')){
            	$("#content").css("height",contentHeight);
		$(".swiper-wrapper").css("height",contentHeight);
		$(".swiper-slide").css("height",contentHeight);
		$("html").css("overflow","hidden");
	    }else{
		$("#content").css("height","auto");
	    }
        });
    });

Aqui está o site:

http://sistemas.vilavelha.com.br/Newsletter/Ricardo/teste/index2.asp

 

Agradeceria qualquer ajuda!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Hum.. vc tentou fazer apenas com css ?

 

html, body { height: 100% }
e então estar 100% para tua div tb ?

assim não usa nenhum js, e vai funcionar.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Já tentei sim, não ei se fui eu que fiz algo errado mas não funcionou e eu parti pro js.

 

Ele resolveu bme a situação, exceto por esse erro no redimensionamento :/

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.