Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
Crayon Shin Chan
Minister of Gerbil Affairs
Topic Author
Posts: 2313
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Javascript: changing className with HTMLElement!=this

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">'.
<?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!
Mothership: FX-8350, 12GB DDR3, M5A99X EVO, MSI GTX 1070 Sea Hawk, Crucial MX500 500GB
Supply ship: [email protected], 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Thinkpad X230

Who is online

Users browsing this forum: No registered users and 4 guests
GZIP: On