Heellllo!
I'm developing some themes for dokuwiki and in this themes I want to include a button to "Go To Top". But what I want is to show the button only when the user scrolls the window 300px. Were the button with the id "top" is hidden with javascript so if the user doesn't have javascript on, then the button is always showed:
I thought dokuwiki used jQuery or the mootools and is not working. So if someone could help me with the funcionality, my code is this:
window.addEvent('domready', function() {
$('top').setStyle('display','none');
((window.getScrollSize().y + 300 )> window.getSize().y) ? $('top').fade(1) : $('top').fade(0)
});
Thanks,
Ana
EDIT: I went to other forums to ask the same question and it appears that "Dokuwiki uses jQuery but you have to use 'jQuery' and not the default '$'... Also DokuWiki has moved away from the old js framework and its now using jquery only for everything (the move is till going on).... you can have a look at https://github.com/piyushmishra/dokuwiki-extension-manager/blob/master/script.js for better idea of how to go about it and also at http://www.dokuwiki.org/devel:javascript"
Also this can be usefull: http://api.jquery.com/jQuery.noConflict/
This is why my code wasn't working since I was using the '$' selector. For those who want to use a selector you should use 'jQuery' insted of the '$'. Coming soon some free templates to contribute to the project. For now I'm not with much time but eventualy I will upload them. Bye