Javascript: changing className with HTMLElement!=this
Posted: Wed Mar 04, 2009 10:54 pm
The situation: I have Wordpress 2.7.1, and I only want to display the title of a widget, not its contents. The contents will be displayed when the user puts the mouse over the text of the title.
I figured using Javascript to change classes using onmouseover and onmouseoff would be a reliable way that works in IE5,6 as well. My JS isn't that great, though, so I'm having trouble expressing '<div class="widcontent">' under 'this', where 'this' is '<div class="widtitle">'.
Help? Thanks!
I figured using Javascript to change classes using onmouseover and onmouseoff would be a reliable way that works in IE5,6 as well. My JS isn't that great, though, so I'm having trouble expressing '<div class="widcontent">' under 'this', where 'this' is '<div class="widtitle">'.
Code: Select all
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget'=>'<div class="indwiget">',
'after_widget'=>'</div></div>',
'before_title'=>'<div class="widtitle" onmouseover="widcontent?.className=\'widcontentv\'">',
'after_title'=>'</div><div class="widcontent">',
));
?>
Help? Thanks!