Quora: focus on a single answer
Dims every answer except the one under the cursor, making it easier to focus on one at a time.
Code to copy
// Focus mode: dim every answer except the one under the cursor
function setupFocus() {
document.querySelectorAll('div[class*="puppeteer_test_answer_content"]').forEach(function (a) {
if (a.dataset.jzFocus) { return; }
a.dataset.jzFocus = '1';
const wrap = a.closest('[class*="q-box"]') || a;
wrap.style.transition = 'opacity 0.2s ease';
wrap.addEventListener('mouseenter', function () {
document.querySelectorAll('div[class*="puppeteer_test_answer_content"]').forEach(function (o) {
const ow = o.closest('[class*="q-box"]') || o;
ow.style.opacity = (ow === wrap) ? '1' : '0.3';
});
});
});
document.addEventListener('mouseleave', function () {
document.querySelectorAll('div[class*="puppeteer_test_answer_content"]').forEach(function (o) {
const ow = o.closest('[class*="q-box"]') || o;
ow.style.opacity = '1';
});
});
}
setupFocus();
const obs = new MutationObserver(setupFocus);
obs.observe(document.documentElement, { childList: true, subtree: true });
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.