Ar javaskripta paliidziibu veelo lai sidebar daljas buutu vienaadaa garumaa kaa videejaa dalja maajaslapai. Ar shi skripta paliidziibu daljeeji izdevaas to paveikt tikai probleema taada ka tagad sidebar daljas ir krietni garaakas par videejo dalju un nebeidzas tur kur beidzas videejaas daljas saturs. Kaads vareetu buut risinaajums?
<script type="text/javascript">
// plugin
jQuery.fn.equalHeights=function() {
var maxHeight=0;
this.each(function(){
if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
Question
gkazhus
Ar javaskripta paliidziibu veelo lai sidebar daljas buutu vienaadaa garumaa kaa videejaa dalja maajaslapai. Ar shi skripta paliidziibu daljeeji izdevaas to paveikt tikai probleema taada ka tagad sidebar daljas ir krietni garaakas par videejo dalju un nebeidzas tur kur beidzas videejaas daljas saturs. Kaads vareetu buut risinaajums?
<script type="text/javascript">
// plugin
jQuery.fn.equalHeights=function() {
var maxHeight=0;
this.each(function(){
if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
});
this.each(function(){
$(this).height(maxHeight);
if (this.offsetHeight>maxHeight) {
$(this).height((maxHeight-(this.offsetHeight-maxHeight)));
}
});
};
// usage
$(function() {
$('.sidebar_first, .content, .sidebar_second').equalHeights();
});
</script>
Link to comment
Share on other sites
12 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.