frio: fix for display auto position scroll + some cleanup
This commit is contained in:
parent
c7eb7ba73f
commit
7e65d84577
3 changed files with 31 additions and 14 deletions
|
@ -542,3 +542,22 @@ String.prototype.rtrim = function() {
|
|||
var trimmed = this.replace(/\s+$/g, '');
|
||||
return trimmed;
|
||||
};
|
||||
|
||||
// Scroll to a specific item and highlight it
|
||||
// Note: jquery.color.js is needed
|
||||
function scrollToItem(itemID) {
|
||||
if( typeof searchValue === "undefined")
|
||||
return;
|
||||
|
||||
// Define the colors which are used for highlighting
|
||||
var colWhite = {backgroundColor:'#F5F5F5'};
|
||||
var colShiny = {backgroundColor:'#FFF176'};
|
||||
|
||||
// Scroll to the DIV with the ID (GUID)
|
||||
$('html, body').animate({
|
||||
scrollTop: $('#item-'+itemID).position().top
|
||||
}, 400, function() {
|
||||
// Highlight post/commenent with ID (GUID)
|
||||
$('#item-'+itemID).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue