Opis
Wysokość zawartości można zrównać z wysokością innej zawartości, dołączając korektor danych atrybutu . Aby wysokość elementu podrzędnego była taka sama, jak wysokość elementu nadrzędnego, użyj atrybutu data-equalizer-watch .
Przykład
Poniższy przykład demonstruje użycie wtyczki korektora w Foundation -
<!DOCTYPE html>
<html>
<head>
<title>Foundation Template</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<!-- Compressed CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/foundation.min.css" crossorigin="anonymous">
<!-- Compressed JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/foundation.min.js" crossorigin="anonymous"></script>
</head>
<body>
<h2>Example of Equalizer</h2>
<div class = "row" data-equalizer>
<div class = "medium-4 columns">
<div class = "callout" data-equalizer-watch style = "background-color:#C0B0F0;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class = "medium-4 columns">
<div class = "callout" data-equalizer-watch style = "background-color:#8BD6EE;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
</div>
</div>
<div class = "medium-4 columns">
<div class = "callout" data-equalizer-watch style = "background-color:#C0B0F0;">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s
</p>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
Wynik
Wykonajmy następujące kroki, aby zobaczyć, jak działa powyższy kod -
Zapisz powyższy kod html equalizer_basic.html plik.
Otwórz ten plik HTML w przeglądarce, wyjście zostanie wyświetlone, jak pokazano poniżej.