MyBB Community Forums

Full Version: Does extra Javascript need to be inserted in a specific place?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to the Mootools "Tooltip" I have on my main website to work on my forum. But for some reason, it won't work at all, even though everything is uploaded as it should be.

This is my headerinclude...

{$metadescription}
{$metakeywords}
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<script type="text/javascript" src="jscripts/shoutbox.js?ver=121"></script>
<script type="text/javascript" src="jscripts/mootools.js"></script>
<script type="text/javascript" src="jscripts/prototype.lite.js?ver=121"></script>
<script type="text/javascript" src="jscripts/moo.ajax.js?ver=121"></script>
<script type="text/javascript" src="jscripts/general.js?ver=121"></script>
<script type="text/javascript" src="jscripts/popup_menu.js?ver=121"></script>
	<script type="text/javascript">
window.addEvent('domready', function(){
/* Tips 1 */
var Tips1 = new Tips($$('.Tips1'));
 
/* Tips 2 */
var Tips2 = new Tips($$('.Tips2'), {
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
	},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	}
});
 
/* Tips 3 */
var Tips3 = new Tips($$('.Tips3'), {
	showDelay: 400,
	hideDelay: 400,
	fixed: true
});
 
/* Tips 4 */
var Tips4 = new Tips($$('.Tips4'), {
	className: 'custom'
});
}); 
</script>

<link rel="stylesheet" type="text/css" href="{$theme['css_url']}" />
<script language="Javascript" type="text/javascript">
<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var newpm_prompt = "{$lang->newpm_prompt}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
// -->
</script>
{$newpmmsg}

As you can see, I have the link to mootools.js, and the extra Tooltips JS code. And if you check my forum's source code and CSS, it is done properly.

Does anyone know what's causing MyBB not to have this work as it should (like, does the Tooltip JS need to be in a certain place for MyBB to parse it?)?
Could you try changing domready to load? As domready gets parsed when elements are ready, not the whole page. So maybe your scripts isn't ready then.
CraKteR Wrote:Could you try changing domready to load? As domready gets parsed when elements are ready, not the whole page. So maybe your scripts isn't ready then.

You meant changing the domready text to load, right? If so, it didn't change anything. x_x

EDIT: Hmm...seems my mootools.js file creates an issue with the post editor. I guess I'll just drop trying to do this for the time being. You can lock/remove/etc. this post if you want.