3

Alright, so I have no idea what's going on here... I'm trying to apply a ToolTip with a class as the selector. The examples on their website are using and ID as the selector, but that's not possible for me because there are going to be several similar objects that need the ToolTip.

http://flowplayer.org/tools/demos/tooltip/any-html.html

The thing is, I need HTML within the ToolTip... I can't just use the "title" attribute.

Here is code I'm dealing with:

<ul id="mycarousel" class="jcarousel-skin-tango">
    <?php $loop = new WP_Query( array( 'post_type' => 'staff', 'order' => 'ASC') ); ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    <li class="staff-member">
        <img src="<?php print_custom_field('staff_photo:to_image_src'); ?>" width="135" height="200" />
    </li>
    <div class="tooltip">
        <img src="http://static.flowplayer.org/img/title/eye.png" alt="Flying screens" 

        <?php the_title(); ?><br />
        <?php print_custom_field('staff_position'); ?>

    </div>

<?php endwhile; ?>
</ul>

As you can see, the image or the LI needs to be the ToolTip hook... the documentation says that the NEXT element is assumed to be the ToolTip content. ... but it doesn't work.

Prasanth
  • 3,029
  • 31
  • 44
dcolumbus
  • 9,596
  • 26
  • 100
  • 165

1 Answers1

0

Not sure if this fully solves your problem, but to select an element in jQuery based on the class, use this syntax: $('.classname'). Therefore in your example, it would be $('.tooltip')

For more info on the different jQuery selectors, check out the api documentation

Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
Paul
  • 804
  • 2
  • 13
  • 31