0
My website is basically like this:
img http://www.mediafire.com/convkey/3266/gr3pg3kqokxkkduzg.jpg
I make the following script to keep block #right from #left height:
$('#right').height($('#left').height());
but when I put some content in the left block, the right block gets a little smaller:
img http://www.mediafire.com/convkey/2332/k1wrdjdpgsc5x56zg.jpg
If you want to see the site: http://itbinds.tk/tutoriais/informatica/ompp/ompp.html
How should I do?
From now on, thank you!!!
The code is correct, see example in Jsfiddle. Maybe you’re forgetting to include any more information. If possible, work with the real problem instead of "#left" and "#right" use the classes/ids you’re manipulating on the site.
– Renan Gomes
If you want to keep these blocks the same height you have to run that line of code every time one of them changes size/height. You’ve tried that?
– Sergio
I’ll skip your question a little. If I understand correctly, your problem is with the layout. The ideal place to solve layout problems is in CSS without involving Javascript. Your site layout is very close to a two columns classic. I would recommend to search for articles on this layout and adapt to your problem. That article list some layout examples with CSS.
– sergiopereira
@Sergiopereira but partner, the height is all buggy, it is easier mt it leave a malleable height with JS
– Andrey Hartung
@Andreyhartung I understand your point of view, but I see it differently. If it were as easy as it sounds, we wouldn’t be here looking for answers to this problem. My suggestion was just to consider a CSS-only solution because this is basically a problem already solved and with many examples out there. I’ve never had long-term luck with JS solutions for this type of problem.
– sergiopereira