我使用以下 JS 代码创建等高列:
var colHeight = Math.max($('.3columngallery .col1').height(), $('.3columngallery .col2').height(), $('.3columngallery .col3').height());
$('.3columngallery .gallery').height(colHeight);
它在 Firefox 和 Safari 中运行良好,但在 Chrome 和 Opera 中运行不佳。
这是页面的链接,我在其中使用了此脚本:http://www.jaspreetkaur.com/gwstudio/product-gallery
最佳答案
如果您在此容器内使用图像,则应该使用
$(window).load(function ()
而不是
$(function() {
因为图片没有加载到dom中。
关于javascript - 等高柱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9837456/