mirror of https://gitgud.io/fatchan/jschan.git
parent
b85afbb0db
commit
0cca3603de
2 changed files with 18 additions and 1 deletions
@ -0,0 +1,17 @@ |
||||
window.addEventListener('DOMContentLoaded', (event) => { |
||||
|
||||
var quotes = document.getElementsByClassName('quote'); |
||||
|
||||
var toggleHighlightPost = function(e) { |
||||
var hash = this.hash.substring(1); |
||||
var anchor = document.getElementById(hash); |
||||
var post = anchor.nextSibling; |
||||
post.classList.toggle('highlighted'); |
||||
}; |
||||
|
||||
for (var i = 0; i < quotes.length; i++) { |
||||
quotes[i].addEventListener('mouseover', toggleHighlightPost, false); |
||||
quotes[i].addEventListener('mouseout', toggleHighlightPost, false); |
||||
} |
||||
|
||||
}); |
Loading…
Reference in new issue