Created
October 1, 2018 09:17
-
-
Save DevShahidul/2bb1a283ab3486bb0c054404573c086e to your computer and use it in GitHub Desktop.
See the example on vigor and vice project and here >>> https://stackoverflow.com/questions/7420434/jquery-how-to-get-elements-margin-and-padding/7420530
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var totalItem = $('#firstMiddle-link-info li').length, | |
| tM = $("#secondMiddle-link-info li").css("margin").split(" "), | |
| Margin = { | |
| Top: tM[0] != null ? parseInt(tM[0]) : 0, | |
| Right: tM[1] != null ? parseInt(tM[1]) : (tM[0] != null ? parseInt(tM[0]) : 0), | |
| Bottom: tM[2] != null ? parseInt(tM[2]) : (tM[0] != null ? parseInt(tM[0]) : 0), | |
| Left: tM[3] != null ? parseInt(tM[3]) : (tM[1] != null ? parseInt(tM[1]) : (tM[0] != null ? parseInt(tM[0]) : 0)) | |
| }, | |
| TotalMargin = Margin.Right + Margin.Left, | |
| totalElementMargin = TotalMargin * totalItem; | |
| console.log(totalElementMargin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment