4 ms·
@dang, if you're listening, an idea: make the "upvote" buttons invisible on stories that the user hasn't visited before. This could be done like so: // cs
by rattray 11y ago
@dang, if you're listening, an idea:
make the "upvote" buttons invisible on stories that the user hasn't visited before. This could be done like so:
// css
a.upvote-botton:visited { visibility: hidden };
<!-- in html -->
<a href="{article_link}" onclick="perform_upvote()" class="upvote-button">upvote triangle</a>
The href & onclick handlers would need to be added in javascript so as not to affect hn for non-js users.
- svl 11y agoThat doesn't actually work in pretty much any browser, since it allows for history-mining by a malicious site. :visited styling changed a couple of years ago to only honor color changes, thus preventing most ways of exploiting that issue. http://dbaron.org/mozilla/visited-privacy http://dbaron.org/mozilla/visited-privacy is one of the better resources explaining the issue more fully. I guess you could create the triangle solely with CSS borders, and then style the border-color to be the same color as the background when not :visited