Thanks to the author Rob Glazebrook from Newbie
Server side script from Newbie(Jquery)
<script language="javascript" type="text/javascript" src="jquery-1.3.2.js"></script>
<script>
function equalHeight(group) {
tallest = 0;
group.each(function() {
thisHeight = $(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
}
$(document).ready(function() {
equalHeight($(".column"));
});
</script>
<script>
function equalHeight(group) {
tallest = 0;
group.each(function() {
thisHeight = $(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
}
$(document).ready(function() {
equalHeight($(".column"));
});
</script>
Server side script from me(Prototype)
<script language="javascript" type="text/javascript" src="prototype-1.6.0.3.js"></script>
<script language='javascript'>
function equalHeight(group) {
tallest = 0;
group.each(function(c) {
thisHeight = c.offsetHeight;
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.invoke("setStyle", {height: tallest + 'px'})
}
Event.observe(window, 'load', function()
{
equalHeight($$(".column"));
});
</script>
<script language='javascript'>
function equalHeight(group) {
tallest = 0;
group.each(function(c) {
thisHeight = c.offsetHeight;
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.invoke("setStyle", {height: tallest + 'px'})
}
Event.observe(window, 'load', function()
{
equalHeight($$(".column"));
});
</script>
For Live action click, here
If you wish to get the code, click here
Suggested reading
Equal height columns - Jquery
No comments:
Post a Comment