Has anyone got a script to highlight node bodies
Unfortunately, I don't know javascript very well - I can barely read it. I was just on what amounts to a blog site where, in this case, the most current node body was highlighted by a mouse-over. But I was thinking that it might be nice to do this for every node body, particularly on sites where there is a background that doesn't lend itself to superior readability. So does anyone have a script that can be used to just change the color of a node body background, perhaps with greater opacity on a mouseover? Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
On Saturday 22 May 2010, nan wich wrote:
Unfortunately, I don't know javascript very well - I can barely read it.
I was just on what amounts to a blog site where, in this case, the most current node body was highlighted by a mouse-over. But I was thinking that it might be nice to do this for every node body, particularly on sites where there is a background that doesn't lend itself to superior readability.
So does anyone have a script that can be used to just change the color of a node body background, perhaps with greater opacity on a mouseover?
Do it in css .node:hover { background: #FFFF00; } or you could do it on .content. I use this method on forms, it tells people when to click to get the cursor in and once its there I use :focus so they know where they are in the form. eg .form-textarea { background-color: #EEE; border: 1px solid #888; font-size:11px; } .form-textarea:focus { background-color: #FFC; border: 1px solid #F88; } .form-textarea:hover { background-color: #FFC; }
Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-- ----------------- Bob Hutchinson Midwales dot com -----------------
Thanks, Bob. Sometimes you just have to hit your forehead and say DUH! ________________________________ From: Bob Hutchinson <hutchlists@midwales.com>
So does anyone have a script that can be used to just change the color of a node body background, perhaps with greater opacity on a mouseover?
Do it in css .node:hover { background: #FFFF00; } or you could do it on .content. I use this method on forms, it tells people when to click to get the cursor in and once its there I use :focus so they know where they are in the form. eg .form-textarea { background-color: #EEE; border: 1px solid #888; font-size:11px; } .form-textarea:focus { background-color: #FFC; border: 1px solid #F88; } .form-textarea:hover { background-color: #FFC; }
Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-- ----------------- Bob Hutchinson Midwales dot com -----------------
Good suggestion, however it won't work in browsers which don't support :hover. If you need to take it further... Start with: .nodehover { background: #FFFF00; } and add this: <script> $(".node").hover( function () { $(this).addClass('.nodehover'); }, function () { $(this).removeClass('.nodehover'); } ); </script> I havent tested this, but barring syntax errors, it should work. chris On 23/05/2010, at 5:18 AM, nan wich wrote:
Thanks, Bob. Sometimes you just have to hit your forehead and say DUH!
From: Bob Hutchinson <hutchlists@midwales.com>
So does anyone have a script that can be used to just change the color of a node body background, perhaps with greater opacity on a mouseover?
Do it in css
.node:hover { background: #FFFF00; }
or you could do it on .content. I use this method on forms, it tells people when to click to get the cursor in and once its there I use :focus so they know where they are in the form. eg .form-textarea { background-color: #EEE; border: 1px solid #888; font-size:11px; } .form-textarea:focus { background-color: #FFC; border: 1px solid #F88; } .form-textarea:hover { background-color: #FFC; }
Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-- ----------------- Bob Hutchinson Midwales dot com -----------------
participants (3)
-
Bob Hutchinson -
Chris Skene -
nan wich