Created
September 4, 2013 22:54
-
-
Save jdaly13/6443911 to your computer and use it in GitHub Desktop.
start of replacement for marvel module
This file contains 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 relatedProductsContainer = $("#relatedProducts"); | |
relatedProductsContainer.find('article').each(function(index, element) { | |
var containerHeight = [] | |
var $element = $(element); | |
var liFirstChild = $element.find('div.product_content ul.product_description_list li:first-child'); | |
var liLastChild = $element.find('div.product_content ul.product_description_list li:last-child'); | |
var liOnlyChild = $element.find('div.product_content ul.product_description_list li:only-child'); | |
var liSpanElement = liFirstChild.children('span:first-child'); | |
var lastLiSpanElement = liLastChild.children('span'); | |
var more = $('<a class="more_or_less more" style="cursor:pointer">more</a>'); //more trigger | |
var less = $('<a class="more_or_less less" style="cursor:pointer">less</a>'); //less trigger | |
more.insertAfter(liSpanElement); | |
less.insertAfter(lastLiSpanElement); | |
containerHeight[index] = $element.eq(index).outerHeight(); | |
console.log(containerHeight); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment