Hi there, i am quite new to web development.

is it possible to use this with CCK's select list? if so how?

many thanks.

Comments

foodbo’s picture

More details.....

What i want is that when the select list is clicked then the "tips" popup with his own "description" (help text), just like the text filed / area in the form.

I have tried them, the first one, popup the "xxxxx xxxxx xxxxx", kind of what i want but would prefer to display its own help text.
the second one, popup all the help text from the form...... so how can i specify its own help text?

another problem that i have found is that, the popup tip won't go away if i use with "hierarchical_select" module and the filed has a sub select list. (as long as i just select an item from the first list then it is fine. if i select the sub select list item then the popup won't go away)

$(function(){
$('#edit-field-identifier-tids-hierarchical-select-selects-0').bt(' xxxxxx xxxxxxxx xxxxxxxxxxxx',
    {
    fill: '#FFF',
    cornerRadius: 10,
    strokeWidth: 0,
    shadow: true,
    shadowOffsetX: 3,
    shadowOffsetY: 3,
    shadowBlur: 8,
    shadowColor: 'rgba(0,0,0,.9)',
    shadowOverlap: false,
    noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
    trigger: ['focus', 'blur'],
    positions: ['left', 'top']
  });
  


$('.description').hide();
$('.form-item').bt({
  positions: 'top',
  contentSelector: "$('.description')",  
  trigger: 'click',
  width: 220,
  centerPointX: .9,
  spikeLength: 65,
  spikeGirth: 40,
  padding: 15,
  cornerRadius: 25,
  fill: '#FFF',
  strokeStyle: '#ABABAB',
  strokeWidth: 1
});
 
 }); 

kleinmp’s picture

For the second one here, i suggest trying to use this for the content selector:
$(this).nextAll('.description:eq(0)').html()
That is what is used in the textfield to grab the description. I'm not sure if this will necessarily work, though, you may have to inspect the form item inorder to find it's relationship between the object that is being beautytipped and the content that will popup.

For the popup that won't go away, i'd suggest playing around with the trigger. I've never used the popup with hierarchical select, though, so I'm not sure why it won't go away.

foodbo’s picture

thanks.

1. $(this).nextAll('.description:eq(0)').html() that didn't work. :-( only works for specify selector (#edit-field-abc-value) but not general selector "form-item".
2. I have played around with the trigger but still the same :-(

------

3. Another problem, If i have more than one #tips001 selector on the same page, it will only show the popup for the first one, and the rest wont' work :-(, why is that? a bug? what is the way that i can do the same ( define once and use many times)

$('#tips001').bt('OOhhh.. coming soon!!',
{
  fill: '#FFF',
    cornerRadius: 10,
    strokeWidth: 0,
    shadow: true,
    shadowOffsetX: 3,
    shadowOffsetY: 3,
    shadowBlur: 8,
    shadowColor: 'rgba(0,0,0,.9)',
    shadowOverlap: false,
    noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
    trigger: ['click'],
    positions: ['left'],
    width: 320
});
foodbo’s picture

Well, the follow code works with the ".form-select" selector, as long as the form-select is the first one, the rest on the same page does not work.
The strange thing is that, I can see from the firebug, the class changes from [class="form-select"] to [class="form-select bt-active"] when mouse over on the item, (even for the rest) but no popup, except the first one.

any ideas????

$('.description').hide();
$('.form-select').bt({  
  contentSelector: "$(this).nextAll('.description:eq(0)').html()",
   width: 250
});
<select id="edit-field-relationinterests-value" class="form-select<b> bt-active</b>" multiple="multiple" name="field_relationinterests[value][]" bt-xtitle="" title=""><option value="310">..........................
kleinmp’s picture

To add beautytips to multiple items you can try something like this.

$('my-selector').each(function() {
  $(this).bt(. . .options-and-text. . .);
});

As far as question 4 is concerned, since the bt-active class is being added to the element, then that means the beautytips are being added correctly. The problem must then lie in the contentSelector. In order to debug that, i'd really have to inspect the element that you're trying to show and see the exact relationship between it and the element that the beautytips are being added to.

ratinakage’s picture

Version: 6.x-1.1 » 6.x-2.0

Did anyone ever find an easy way to add beauty tips to CCK select lists?

Its wierd that it works out of the box for text fields but no implementation for other fields such as CCK select. Please could you let me know whats the easiest way.

Thanks!

duckzland’s picture

Adding these lines in the module hook_init should give the select element and checkbox beauty tips

   $options['bt_select_element'] = array(
      'cssSelect' => '.form-select',
      'contentSelector' => "$(this).parents('.form-item').find('.description').hide().html()",
      'trigger' => array('mouseover', 'click'),
      'width' => 350,
      'style' => 'hulu',
    );
		$options['bt_checkbox_element'] = array(
      'cssSelect' => 'label.option',
      'contentSelector' => "$(this).parents('.form-item').find('.description').hide().html()",
      'trigger' => array('mouseover', 'click'),
      'width' => 350,
      'style' => 'hulu',
    );
	
    beautytips_add_beautytips($options);

but really shouldn't this be default / configurable in the module? or am I missing something here?

ratinakage’s picture

Thanks!

Could you explain to me which exact file I would need to be editing?

Cheers...

kleinmp’s picture

This is a duplicate to #849738 and to #697070. I just added the select box functionality to the dev version.

duckzland’s picture

Sorry didn't see the #849738 and to #697070, btw in the dev version is it possible to have an auto remove bubble with timer? the reason for this is sometimes the bubble will stay visible even after the element is removed using ajax / ahah. Which we can't remove the bubble at all since the bubble doesn't have close button.

As for the code, you need to put them in the .module file but I think it is better to use the dev version since my code is a quick dirty hack code. :)

djween’s picture

Hello,

As per #5 I am trying to use Beautytips on a selector that appears on a page multiple times.
However, I cannot make this work.
Each balloon has its own content as that is pulled from the destination specified in the href of the anchor with which contains the selector.
ex...

<a href="url 1" id="help_icon">whatever</a>
<a href="url 2" id="help_icon">blah</a>
<a href="url 3" id="help_icon">wawa</a>

Then I have the following once on the page top and the beautytip only works for the item highest on the page when it is triggered.

<?php
    drupal_add_js (
    '$(document).ready(
    function(){

$(\'#help_icon\').each(function() {
    $(this).bt(
    {
trigger: [\'mouseover\',\'click\'],
    ajaxPath: ["$(this).attr(\'href\')",\'div#content-area div.content\']
});
    });
    });', 'inline'
    
    
    );
    ?>
    

Anyone able to help? Seems like others have had this issue.

Thanks,

Dan

duckzland’s picture

dont use css id for multiple item, change them to class instead

djween’s picture

Thanks duckzland, that worked!

pifagor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
maria.dis’s picture

Well... years have passed, with new version and it seems that there is no documentation on how to use this module after installation.