On Wed, Aug 12, 2009 at 11:26 AM, Mr Fett<[email protected]> wrote:
>
> Thanks for the extra info guys - perhaps I'm reading it wrong but
> wouldn't that mean that my help buttons text was the content of my
> dialog box rather than the word "help"?
The "help" is there, along with the dialog text -- until the dialog
text is hidden by this line:
$('.helper span').hide();
Your method would also work, (with a small change to the script),
however, A tags don't officially allow alt attributes, and you're
still limited to what you can stuff into an attribute:
Script for using alt attribute: (remove all references to the SPAN)
$('#dialog').dialog({ autoOpen: false });
$('.helper').click(function()
{
var aTag = $(this);
$('#dialog').html(aTag.alt())
.dialog('option', 'title', aTag.title())
.dialog('open');
return false;
});
<a class="helper" href="#" title="Da Da" alt="Body text for my dialog
box">help</a>
The advantage of using the span method I showed is that you can make
you help text more elaborate:
<a class="helper" href="#" title="Da Da">help
<span>This is the <b>Body</b> text for my <em>dialog box</em><br/>
I can make it multi-lined, and include all kinds of
<ul>
<li>lists</li>
<li>Tables</li>
<li>images</li>
<li>and other markup .</li>
</ul>
that I could never put into an attribute!
</span></a>
>
> Perhaps I could do something like this:
>
> $('#dialog').dialog({ autoOpen: false });
> $('.helper span').hide();
> $('.helper').click(function()
> {
> var aTag = $(this);
> $('#dialog').html($('span', aTag).alt())
> .dialog('option', 'title', aTag.title())
> .dialog('open');
> });
>
>
> <a class="helper" href="#" title="Da Da" alt="Body text for my dialog
> box">help <span>HELP</span></a>
>
> Thanks again
>
> Bob
>
> On Aug 12, 10:49 am, James Curran <[email protected]> wrote:
>> On Wed, Aug 12, 2009 at 10:46 AM, James Curran<[email protected]> wrote:
>> > <a class="helper" href="#" title='Da Da'>help <span>Enter a Date</span></a>
>>
>> And of course the next phase of evolution would be to write it as
>> <a class="helper" href="#" title='Da Da'>Enter a Date</a>
>>
>> and then have the staqrtup code extract the html of each in .helper,
>> wrap it in span tags, hid those elements, and then insert the 'help'
>> text --- but that will be left as an exercise for the student....
>>
>> --
>> Truth,
>> James Curran
> >
>
--
Truth,
James
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---