top



Hi everyone,
I have a little stupid problem, see if you can help me.
Look, I wanted to use a tooltip in my forum and wanted to add it to the template. The problem is that, when I putt in a template, it does not work anymore. But in a html page it does. Why?


Code:
<a class="tip_trigger"> Link Key Word <span style="display: none; top: 378px; left: 740px;" class="tip">This will show up in the tooltip</span></a>   
   
   
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
    <script type="text/javascript">
$(document).ready(function() {
    //Tooltips
    $(".tip_trigger").hover(function(){
        tip = $(this).find('.tip');
        tip.show(); //Show tooltip
    }, function() {
        tip.hide(); //Hide tooltip
    }).mousemove(function(e) {
        var mousex = e.pageX + 20; //Get X coodrinates
        var mousey = e.pageY + 20; //Get Y coordinates
        var tipWidth = tip.width(); //Find width of tooltip
        var tipHeight = tip.height(); //Find height of tooltip

        //Distance of element from the right edge of viewport
        var tipVisX = $(window).width() - (mousex + tipWidth);
        //Distance of element from the bottom of viewport
        var tipVisY = $(window).height() - (mousey + tipHeight);

        if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
            mousex = e.pageX - tipWidth - 20;
        } if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
            mousey = e.pageY - tipHeight - 20;
        }
        //Absolute position the tooltip according to mouse position
        tip.css({  top: mousey, left: mousex });
    });
});    </script>

I deleted my template changes, so that can't be the problem. Greetings
Arane (sorry for my mistakes)

EDIT :
Found this: "You cannot use BBCodes in templates. "
Oha. Is that why it's not working?

Where do you add the script in the templates? Smile
And its not BBcode Smile

In index_body
right on top

try add the SCRIPT not the HTML inside the head tag in overall_header Smile

Not working
This is the script, that I've added to overall header

Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
    <script type="text/javascript">
$(document).ready(function() {
    //Tooltips
    $(".tip_trigger").hover(function(){
        tip = $(this).find('.tip');
        tip.show(); //Show tooltip
    }, function() {
        tip.hide(); //Hide tooltip
    }).mousemove(function(e) {
        var mousex = e.pageX + 20; //Get X coodrinates
        var mousey = e.pageY + 20; //Get Y coordinates
        var tipWidth = tip.width(); //Find width of tooltip
        var tipHeight = tip.height(); //Find height of tooltip

        //Distance of element from the right edge of viewport
        var tipVisX = $(window).width() - (mousex + tipWidth);
        //Distance of element from the bottom of viewport
        var tipVisY = $(window).height() - (mousey + tipHeight);

        if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
            mousex = e.pageX - tipWidth - 20;
        } if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
            mousey = e.pageY - tipHeight - 20;
        }
        //Absolute position the tooltip according to mouse position
        tip.css({  top: mousey, left: mousex });
    });
});    </script>

you don't need to add this:

Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
because its already there..
hm.. and where you the HTML then? index_body?
forum link?

link

Look for" Your Link Key Word"

Since its a test forum can i test it myself? Smile
if yes.. then send me the FOUNDER account for i can't use the templates..

It doesn't work and i don't know why Razz
u may try this:
http://www.worlddezign.com/t859-tooltips

[locked]