Jquery to keep Height of Image / image container to same height height not working
Dear Sir
refer
I want to keep the height of image part same this webpage same
The jquery has adjusted the height of DIV (class='container1') perfectly for all image on this page
this is because
- .container1 {
-
- height: 400px;
- overflow: hidden;
- background: #fff;
- margin: 10px;
- padding:10px;
- text-align: center;
- vertical-align: middle;
-
-
- }
However i want name to be aligned properly ...this can happen
html
- <div class="s-12 m-6 l-3" style="padding-top:10px; padding-left:20px; padding-right:20px;">
-
- <div class="container1" style="border:1px solid #CCC ;" >
-
- <table width="70%" border="0" cellspacing="0" cellpadding="0" class="tblpart">
- <tr>
- <td align="center" class="imagepart" ><a href="<?php echo $srows['bigwimage'];?>" class="with-caption image-link" title="<?php echo $srows['name'];?>"> <img src="<?php echo $srows['smallwimage'];?>" >
- </a>
- </td>
- </tr>
- <tr>
- <td class="text22 namepart"><?php echo $srows['name'];?> </td>
- </tr>
- </table>
-
-
- </div>
- </div>
Jquery to keep height of container same
- <script type="text/javascript">
- $(document).ready(function() {
-
- var maxHeight=0;
- $('.imagepart').each(function() {
- maxHeight = Math.max(maxHeight, $(this).height());
-
- }).height(maxHeight);
-
- var maxHeight=0;
- $('.namepart').each(function() {
- maxHeight = Math.max(maxHeight, $(this).height());
-
- }).height(maxHeight);
- var maxHeight=0;
- $('.tblpart').each(function() {
- maxHeight = Math.max(maxHeight, $(this).height());
-
- }).height(maxHeight);
- var maxHeight=0;
- $('.container1').each(function() {
- maxHeight = Math.max(maxHeight, $(this).height());
-
- }).height(maxHeight+4);
- });
-
- </script>
I tried Developer tools : Console in chrome browser
I am getting following error
- product.php:1094 Uncaught TypeError: $(...).magnify is not a function