David,
Is there any way that you can just reference a separate file with your
script in it? That's the preferred way. You can then put <script
src="yourfilename.js"></script> in the head of your document. Then in
yourfilename.js, you put the cluetip line inside a document ready:
$(document).ready(function() {
$('whatever').cluetip();
});
You won't have to worry about any of this stuff then, and you can keep
the behavior separate from the content.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Jul 4, 2008, at 8:01 PM, David Morton wrote:
wait, that still doesn't quite explain it all...
The other way I tried it was to have a span right after the link
that contain the tooltip text, with a class matching the rel link in
the anchor. Then I called the script to load local after the table,
after the form actually.
On Fri, Jul 4, 2008 at 6:41 PM, David Morton <[EMAIL PROTECTED]>
wrote:
erg. The data is available in a loop while in the table... I'll
have to loop again to output the javascript. Drat that IE stuff.
I'll give it a shot. Maybe I can capture the javascript string in
variable as I loop and then output it later.
I have tried to get rid of the tables altogether, but seeing as how
it is rows and columns of data, it's some pretty hard CSS to make it
work.
Thanks for the help!
On Fri, Jul 4, 2008 at 12:47 PM, Karl Swedberg
<[EMAIL PROTECTED]> wrote:
Hi David,
Seems that IE does not like the script being executed from within a
table cell. If you move the scripts out of the body and put them in
the <head> or in a separate file (and make sure you're calling
cluetip from within a document ready), it should work. I had to
clear my cache before IE would work again after making the changes,
but that did the trick.
Here is an example, with the table rows copied and pasted from your
email:
http://test.learningjquery.com/cluetip/demo/table.html
Actually, putting the scripts after the table in the body works too.
The ways of IE are mysterious.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Jul 4, 2008, at 12:24 PM, David Morton wrote:
I even changed it to just have the tip in the call:
<tr class="hambody" id="row_529806"><td align="left">
<a id="link_529806" class="thickbox tip" rel=".tip_529806"
href="view.php?
mail_id=529806&cache_type=ham&address_id=6">two</a>
<script type="text/javascript">$("#link_529806").cluetip("two");</
script>
</td></tr>
<tr class="hambody_alt" id="row_550060"><td align="left">
<a id="link_550060" class="thickbox tip" rel=".tip_550060"
href="view.php?
mail_id=550060&cache_type=ham&address_id=6">three</a>
<script type="text/javascript">$("#link_550060").cluetip("three");</
script>
</td></tr>
And that crashes.
On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg
<[EMAIL PROTECTED]> wrote:
Hi,
I can't tell from the information what is causing the problem, but
if I had to guess, I'd suggest looking at the content that is being
loaded. I've seen problems before when invalid markup, usually
caused by unclosed tags, is inserted into the cluetip. Not sure if
this is the problem here, but maybe it's a place to start.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Jul 3, 2008, at 11:23 PM, dgm wrote:
I'm trying to use cluetip (Looks great!) to display a full text of
otherwise truncated data, in a table. (Email subjects are truncated
for the normal view, but if you mouse over, I want a tooltip to show
the full subject). I'm using php and smarty templates to generate
the
table rows:
<td align="left">
<a id="link_{$row[hamloop].id}" class="thickbox tip"
rel=".tip{$row[hamloop].id}"
href
=
"view
.php
{$
msid
}mail_id
=
{$
row
[hamloop
].id
}&
;cache_type={$cache_type}&address_id={$row[hamloop].address_id}">
{$row[hamloop].subject|truncate:$truncate_subject:"...":true|
escape:'htmlall'}
</a>
<span class="tip{$row[hamloop].id}">{$row[hamloop].subject|
escape:"javascript"|escape:'htmlall'}</span>
</td>
and then at the bottom of the file, I do:
$('a.tip').cluetip({local:true, cursor: 'pointer'});
This works great on Firefox 3, but IE 6 and 7 just give a blank
screen, or a bonk dialog that says the operation was aborted. No
other info. :(
If I take out the cluetip call, it loads ok.
Example output from the code above:
<td align="left">
<a id="link_12345" class="thickbox tip" rel=".tip12345"
href="view.php?
mail_id=12345&cache_type=spam&address_id=10">
A really long subject line...
</a>
<span class="tip12345">A really long subject line was truncated</
span>
</td>
As I understand the docs, the <a rel=".tip12345" ... means it will
put
the <span class="tip12345" text into he tooltip. This is repeated
many times with different id's, so there is still a one to one
mapping
of rel's to spans.
Any ideas as to what is going on?
--
David Morton
[EMAIL PROTECTED] - bulk address
[EMAIL PROTECTED] - direct to my server
--
David Morton
[EMAIL PROTECTED] - bulk address
[EMAIL PROTECTED] - direct to my server
--
David Morton
[EMAIL PROTECTED] - bulk address
[EMAIL PROTECTED] - direct to my server
--
David Morton
[EMAIL PROTECTED] - bulk address
[EMAIL PROTECTED] - direct to my server