diff --git a/view/theme/frio/js/mod_display.js b/view/theme/frio/js/mod_display.js index 1faacaeb73..c93d2c0066 100644 --- a/view/theme/frio/js/mod_display.js +++ b/view/theme/frio/js/mod_display.js @@ -3,9 +3,9 @@ */ // Catch the GUID from the URL -var itemID = window.location.pathname.split("/").pop(); +var itemGuid = window.location.pathname.split("/").pop(); $(document).ready(function(){ // Scroll to the Item by its GUID - scrollToItem(itemID); + scrollToItem('item-'+itemGuid); }); diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index f153fc33ff..1e93be24c0 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -553,11 +553,15 @@ function scrollToItem(itemID) { var colWhite = {backgroundColor:'#F5F5F5'}; var colShiny = {backgroundColor:'#FFF176'}; + // Get the Item Position (we need to substract 100 to match + // correct position + var itemPos = $('#'+itemID).offset().top - 100; + // Scroll to the DIV with the ID (GUID) $('html, body').animate({ - scrollTop: $('#item-'+itemID).position().top + scrollTop: itemPos }, 400, function() { // Highlight post/commenent with ID (GUID) - $('#item-'+itemID).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000); + $('#'+itemID).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 600); }); }