qtip2

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
srachit
Posts: 291
Joined: Sat Jan 05, 2013 6:10 pm

qtip2

Post by srachit »

Has anyone here used qtip2 in any of their projects? I'm trying to use it on my image map but it does not seem to work for some reason.

I took the code from here:
http://qtip2.com/plugins#imagemap

And tried to recreate it in my project, but for some reason it doesnt seem to work. My code is:

Code: Select all

$(document).ready(function(){
function info(txt, title) {
    alert("Hello");
    $('area').qtip({
        content: {
            text: 'Support for area maps with no extra configuration! Awesome.'
        },
    position: {
        my: 'top left',
        at: 'bottom right'
    }
});
}

function writeText(txt)
{
    $('#desc').text(txt);
}
 
$('#HD').mouseover(function(){
        var text = "This is a hard drive";
        var title = "Hard Drive";
        writeText(text);
        info(text, title);
});
    
$("#CPU").mouseover(function(){
    var text = "This is a CPU";
    var title = "CPU";
    writeText(text);
    info(text, title);
});
});
I know it enters the info function because the alert is called each time I go onto one of the image areas, but a qtip doesnt seem to come up
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: qtip2

Post by hallsofvallhalla »

Are you referencing the Qtip script properly? As in including it in your file and CSS file? If you hit f12 and got to console do you see any errors?
User avatar
srachit
Posts: 291
Joined: Sat Jan 05, 2013 6:10 pm

Re: qtip2

Post by srachit »

Thats one of the major problems I am facing, when I check my javascript console on chrome no error ever pops up, so I'm completely clueless as to what is wrong
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: qtip2

Post by Jackolantern »

I would try adding some break points through either Chrome JS Console or Firebug (in FireFox), and just step through it to see where the code should be working and try to figure out where it is breaking down.
The indelible lord of tl;dr
Post Reply

Return to “Beginner Help and Support”