From ac49c026ebd257fabeb73e62afcc21b30fcfc169 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 11 Nov 2010 01:41:46 +0000 Subject: oops - undoing part of the previous commit git-svn-id: http://code.elgg.org/elgg/trunk@7289 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/js/initialise_elgg.php | 261 ++++++++++++++++++++++++++++++++++- 1 file changed, 260 insertions(+), 1 deletion(-) (limited to 'views') diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php index 4e6da8203..3de1c020b 100644 --- a/views/default/js/initialise_elgg.php +++ b/views/default/js/initialise_elgg.php @@ -1,4 +1,4 @@ -"+ widgetdescription +"

"); + + if (e.pageX < 900) { + $("#widget_moreinfo") + .css("top",(e.pageY + 10) + "px") + .css("left",(e.pageX + 10) + "px") + .fadeIn("medium"); + } + else { + $("#widget_moreinfo") + .css("top",(e.pageY + 10) + "px") + .css("left",(e.pageX - 210) + "px") + .fadeIn("medium"); + } + }, + function() { + $("#widget_moreinfo").remove(); + }); + + $("img.more_info").mousemove(function(e) { + // action on mousemove + }); +}; + +// ELGG DROP DOWN MENU +$.fn.elgg_dropdownmenu = function(options) { + +options = $.extend({speed: 350}, options || {}); + +this.each(function() { + + var root = this, zIndex = 5000; + + function getSubnav(ele) { + if (ele.nodeName.toLowerCase() == 'li') { + var subnav = $('> ul', ele); + return subnav.length ? subnav[0] : null; + } else { + + return ele; + } + } + + function getActuator(ele) { + if (ele.nodeName.toLowerCase() == 'ul') { + return $(ele).parents('li')[0]; + } else { + return ele; + } + } + + function hide() { + var subnav = getSubnav(this); + if (!subnav) return; + $.data(subnav, 'cancelHide', false); + setTimeout(function() { + if (!$.data(subnav, 'cancelHide')) { + $(subnav).slideUp(100); + } + }, 250); + } + + function show() { + var subnav = getSubnav(this); + if (!subnav) return; + $.data(subnav, 'cancelHide', true); + $(subnav).css({zIndex: zIndex++}).slideDown(options.speed); + if (this.nodeName.toLowerCase() == 'ul') { + var li = getActuator(this); + $(li).addClass('hover'); + $('> a', li).addClass('hover'); + } + } + + $('ul, li', this).hover(show, hide); + $('li', this).hover( + function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); }, + function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); } + ); + +}); + +}; \ No newline at end of file -- cgit v1.2.3