Travis Michael Heller
Travis Michael Heller

Reputation: 1248

trying to add an extra string to this tooltip but do not know how to add a line space

I am working with the plugin SVGA USA Map from: http://codecanyon.net/item/interactive-svg-usa-map/1021095. I am able to add the extra string but it is appended right next to the state name like so: AlabamaextraString when i want it to appear like this: Alabama extraString

here is the code i playing with i figured their is an easy way of doing this but i am just not thinking of it. directJobs[id] is the extra string i am adding by appending it. Please any help would be greatly appreciated. i don't have access to ask the author as of right now.

    $('#map').next('.point').remove();
    $('#map').after($('<div />').addClass('point'));
    $('.point').html(stateNames[id]).css({
          left: mouseX - 50,
          top: mouseY - 70
    }).append(directJobs[id]).fadeIn();

Upvotes: 0

Views: 42

Answers (1)

Justin Russell
Justin Russell

Reputation: 488

You're appending the directJobs[id] string to stateNames[id] with no other characters separating the two. Something like this should work:

$('#map').next('.point').remove();
$('#map').after($('<div />').addClass('point'));
$('.point').html(stateNames[id]).css({
      left: mouseX - 50,
      top: mouseY - 70
}).append("&nbsp;" + directJobs[id]).fadeIn();

Upvotes: 1

Related Questions