The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Hold me I’m Scared… Drupal, Hovers and Javascript

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #28459
    Ian G

    This is my first trip into javascript and Drupal, so I am a more than a little lost here and I am looking for any kind of help or guidance. The CSS seems pretty straightforward, but I am getting tripped up since I am not sure how to create my own classes when the form is created by a Drupal module.

    Here’s what I wanted to do: I have a site that uses a voting system based off Drigg and Extra Voting Forms and I would like to add a javascript hover fade in/out effect to the vote button to draw attention to it.

    Here is what I understand so far. I found instructions for a hover.fade javascript technique at tut9. Here is the javascript they gave attached to a link with the class .button to go in the head section:


    They throw in some css which I'll leave out for now because it's not important at this point other than to say it builds off the -.button and the hover state to -button span.hover class

    The actual element that I am trying to add the hover to is the vote up button, which is themed here from what I can tell in the module

    $form .= '



    return $form;

    I am aiming to add the hover effect to <label class="karma_up>, but I am lost at that point. I am assuming I need to add the js to the head of the template.php file for the content type that will have this voting system (not sure the right way on that) and that I need to somehow either use the label class "karma_up", redefine or add a new class for the hover state.

    You can see what I have right now at , right now the button is labeled "Nuture IT!" and I added a small gap to make it stand out. Worst case scenario would be that I could try just an alternative image on mouseover so that people would realize that it's a button, but I was trying to get all fancypants and use js for once to see if it would work.
    Any javascript gurus out there that can help me figure this out? I can trade some Drupal answers for it if they are out there...

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.