Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Help Removing / Hiding mouse-over hover link text?

$
0
0
Hello everyone,

I'm new to twine and very new to programming in general, it's been a steep learning curve and I've managed okay so far but I'd like to ask if anyone can help me with a small aesthetic issue. I'd like to remove / hide the text that appears when you hover over a link because it usually describes where the link goes and that could easily spoil things story-wise in twine.

Reading up on the issue I now know that it isn't a problem that can be solved with CSS as it is a part of most browsers' tooltip features (for security reasons) and would require removing title tags from elements in the html completely or using various JavaScript. Researching the second option seemed more reasonable and I came across this script on stackoverflow:
function DisableToolTip(elements) {
    for (var i = 0; i < elements.length; i++) {
        var element = elements[i];
        element.onmouseover = function() {
            this.setAttribute("org_title", this.title);
            this.title = "";
        };
        element.onmouseout = function() {
            this.title = this.getAttribute("org_title");
        };
    }
}
window.onload = function() {
    var links = document.getElementsByTagName("a");
    DisableToolTip(links);
    var images = document.getElementsByTagName("img");
    DisableToolTip(images);
};

which through setting up a generic function allows you to hide the tooltip based on the element's tag. However, this script still doesn't work on twine links which I assume are referred to by a different tag in the html that I'm struggling to suss out.
I image you would have to add an additional line to the last script such as
var ???? = document.getElementsByTagName("????");
 DisableToolTip(????);
filling in the ???? with the appropriate var and tag but I'm not sure what those would be.

Thank you very much to anyone who can help out :)

Viewing all articles
Browse latest Browse all 1844

Trending Articles