/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] [jquery] how to pass an attribute ?

Hi

I’m using a jquery tooltip plug-in that works fine – I have a thumbnail image and when you mouse over it the tooltip shows

however, the image in the tooltip is the thumbnail and I would like to be able to pass it the name of the full-sized image

the jquery call is this :

[code=php]
$(function() {
$(‘.image-list img’).tooltip({
track: true,
delay: 0,
showURL: false,
fade: 250,
bodyHandler: function() {
return $(“<img/>”).attr(“src”, this.src);
}
});
});
[/code]

and the image code is this :

[code=html]<div class=”image-list” style=”width:40px;height:20px;overflow:hidden;margin-bottom:4px;”><img src=”../dyn/th_7574407d8d5e3c36.jpg” style=”width:40px;” /></div>[/code]

what would I need to do in the line below to pass the name of the large image instead of this.src ?

[code=php]return $(“<img/>”).attr(“src”, this.src);[/code]

thanks for any help you cna give

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@steamPunkauthorJul 22.2009 — aha !

As a sheer guess, I gave the img a rel="" and then did this in the js function :

[code=php]bodyHandler: function(){
var vR = $(this).attr('rel');
return $("<img/>").attr("src", vR);
}[/code]


and it works !!

thanks for reading to anyone who read this
×

Success!

Help @steamPunk spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...