Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
moved ucpeople js to page template
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbacon committed Aug 11, 2015
1 parent 3b93d16 commit 5a52436
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
21 changes: 0 additions & 21 deletions js/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,27 +269,6 @@ $(window).resize(function() {
});
$(window).load(function() {
stickyFoot();
$('.page-template-user-people .uc-people .person-image').each(function(index, element) {
var imgWidth = $(this).find('img').width();
var imgHeight = $(this).find('img').height();
console.log(imgWidth + ' x ' + imgHeight);
var width = $(this).width();
$(this).height(width);


/*
// find the shorter side, and set that to 100% of container
if (imgWidth > imgHeight) {
// horizontal images
$(this).find('img').height(width).removeAttr('height').removeAttr('width').addClass('horiztonal');
} else {
// vertical or square images
//$(this).find('img').width(width).removeAttr('width').removeAttr('height').addClass('vertical');;
}
/**/
$(this).css('display', 'block');
});

});
$(window).ready(function() {

Expand Down
17 changes: 17 additions & 0 deletions user-people.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,21 @@ function createTextCell($setting, $field){
<?php include('inc/submenu-closing-tags.php')?>
<?php endwhile; // end of the loop. ?>
</div>
<script type="application/javascript">
function adjustImages(){
jQuery('.person-image').each(function(index, element) {
var imgWidth = jQuery(this).find('img').width();
var imgHeight = jQuery(this).find('img').height();
var width = jQuery(this).width();
jQuery(this).height(width);
jQuery(this).css('display', 'block');
});
};
jQuery(window).resize(function() {
adjustImages();
});
jQuery(window).load(function() {
adjustImages();
});
</script>
<?php get_footer(); ?>

0 comments on commit 5a52436

Please sign in to comment.