added more conditional checks for javascripts to reduce computation load
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
$(function() {
|
||||
$("#c-landings div.data").each(function(i, div) {
|
||||
var $div = $(div);
|
||||
var $image = $div.prev();
|
||||
|
||||
$div.width($image.width() - 10).height($image.height() - 10).offset({top: $image.position().top, left: $image.position().left});
|
||||
});
|
||||
if ($("#c-landings").length) {
|
||||
$(".data").each(function(i, div) {
|
||||
var $div = $(div);
|
||||
var $image = $div.prev();
|
||||
|
||||
$div.width($image.width() - 10).height($image.height() - 10).offset({top: $image.position().top, left: $image.position().left});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user