1
I’m putting together a responsive layout...
My "menucontainer" is fixed...
So the width of it does not match the size of the site interface...
For this reason when the zoom increases it becomes and does not take fluidity.
So, if I could make every window.resize
the size of the "menucontainer" if it matched that of the layout interface, I would force a fluidity.
So I did so (it doesn’t work):
function resizee(){
var box = document.querySelector('.boxinterface');
var hcont = document.querySelector('.headercontainer');
box.style.maxWidth = "1100px";
setInterval(function(){
hcont.style.width = box.style.width;
},3000);
}
window.addEventListener('resize',resizee,false);
resize();
I even managed to solve this problem with media queries
, but I found it not ideal because it has to define several breakpoints
... even more because this is a mere matter of fluidity.
What is the CSS of this
menucontainer
? is usingpx
,%
orem
?– Sergio
It’s not better to work with
%
since the site is responsive?– Renan Gomes
@Renan haha, we think the same at the same time :)
– Sergio
@Sergio Owl Eye, we went straight into the
px
:P– Renan Gomes
pq does not use bootstrap? (http://getbootstrap.com/)
– Pablo Tondolo de Vargas
Voce could use the bootstrap has several spills ready.
– user18806
@Sergio he is in
px
why put yourself in%
gets the biggest mess.– ropbla9
@Sergio http://jsfiddle.net/9p55xp6w/2/
– ropbla9
@ropbla9 this can be done only with CSS, using the
width: inherit;
and establishing awidth
for the parent div (example 80%), thus: http://jsfiddle.net/sq5zwd32/ - I voted to reopen and I will respond if you think you can solve your problem.– Sergio
@Sergio is supposed to work, but here n ta working. When put inherit the menucontainer gets the interface size matedo
– ropbla9
@ropbla9 and has closed the
width
of the father? not only withmax-width
? if you do not have to update jsFiddle or post the full page to see where the problem might be.– Sergio
@ropbla9 I got this to work?
– Sergio
@Sergio, width alone works, max-width doesn’t. Then I set a min-width breakpoint at the other magnification to leave full canvas at a certain point of reduction. This way the fixed header ta accompanying the interface.
– ropbla9