OpenAngelArena / oaa

A really great Dota 2 game mode.
237 stars 227 forks source link

How I can limit the border of tooltip in jquery? #1096

Closed randomnum closed 7 years ago

randomnum commented 7 years ago

Hello I am using tooltip with codemirror , what I want is to make the border of tooltip not out of the border of the editor ... see to this link to show how the border of tooltip out of the border of the editor : https://jsfiddle.net/tooaq4oc/13/ this is the css
.tooltip{background:red;z-index:1000;} this is the script :

var cm = CodeMirror(document.getElementById("editor"), {
    value: "function myScript() {\n    return 100;\n}",
    mode: "javascript",
    indentUnit: 4,
    lineNumbers: true,

});

var textMarker;

$('#add').click(function() {
    textMarker = cm.markText({
        line: 1,
        ch: 4
    }, {
        line: 1,
        ch: 10
    }, {
        className: 'marked-text'
    });

    $('.marked-text').tooltip({
        title: 'This is a return statement sfdl glrflg rgmlf',
        container: 'body',
        delay: { "show": 500, "hide": 100 },
        animation: false
    });
});

$('#remove').click(function() {
    if (textMarker) {
        textMarker.clear();
    }
});

How I can solve this problem ?

Note : I want to title of tooltip appare at all , so the panding 0 can not solve the problem

Maroxis commented 7 years ago

Can you update link? It's not working.

randomnum commented 7 years ago

@Maroxis update link : https://jsfiddle.net/tooaq4oc/15/

DoctorGester commented 7 years ago

I'm sorry to ruin the fun but what does this have to do with OAA?

Haganeko commented 7 years ago

I have no idea what this is. I assumed it was related to this person trying to contribute. Is it not?

randomnum commented 7 years ago

@DoctorGester I search on issuse about tooltip and I found people ask on OAA , so I ask here ... sorry if I ask in wrong place .... But I did not knew where I must ask

DoctorGester commented 7 years ago

This is a DOTA2 custom game repository, it uses its own javascript and XML (not HTML) based UI so the chance of you finding help here is very low.

randomnum commented 7 years ago

can any body help me to find the place I can ask question on tooltip and jquery?

Chronophylos commented 7 years ago

checkout https://stackoverflow.com/