MediaWiki:Imagemap-Hightlight.js: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
keine Bearbeitungszusammenfassung
Zeile 48: Zeile 48:
function mouseAction(e) {
function mouseAction(e) {
var $this = $(this),
var $this = $(this),
context = $this.data('context'),
context = $this.data('context');
activate = e.type == 'mouseover',
$.extend(context, areaHighLighting);
var activate = e.type == 'mouseenter';
li = $this.prop('tagName') == 'LI';
li = $this.prop('tagName') == 'LI';
if (li && activate) { // in this case, we need to test visibility vis a vis scrolling
if (li && activate) { // in this case, we need to test visibility vis a vis scrolling
Zeile 68: Zeile 69:
}
}
}
}
function mouseActionAll(e) {
var $this = $(this),
context = $this.data('context'),
map = $this.data('map');
$.extend(context, areaHighLightingAll);
if (e.type == 'mouseenter') {
$('area', map).each(function() {
var $this = $(this), text = this.title, areas = new Array();
areas.push(this);
drawMarker(context, areas);
});
} else {
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
}
}
   
   
// massage the area "href" and create a human legible string to be used as the tooltip of "li"
// massage the area "href" and create a human legible string to be used as the tooltip of "li"
Zeile 119: Zeile 137:
var href = this.href, cssClass = this['class'] || '';
var href = this.href, cssClass = this['class'] || '';
lis[text] = li = $('<li>', {'class': myClassName})
lis[text] = li = $('<li>', {'class': myClassName})
.append($('<a>', {href: href, title: pageOfHref(href, cssClass), text: text, 'class': cssClass + ' internal'}))  
.append($('<a>', {href: href, title: pageOfHref(href, cssClass), text: text, 'class': cssClass}))  
.bind('mouseover mouseout', mouseAction)
.bind('mouseenter mouseleave', mouseAction)
.data('areas', [])
.data('areas', [])
.data('context', context)
.data('context', context)
Zeile 126: Zeile 144:
}
}
li.data('areas').push(this); //add the area to the li
li.data('areas').push(this); //add the area to the li
$(this).bind('mouseover mouseout', function(e) {li.trigger(e);});
$(this).bind('mouseenter mouseleave', function(e) {li.trigger(e);})
});
});
$(this).bind('mouseenter mouseleave', mouseActionAll)
.data('context', context)
.data('map', map);
ol.addClass('mw-collapsed')
ol.addClass('mw-collapsed')
.makeCollapsible();
.makeCollapsible();
2.255

Bearbeitungen

Navigationsmenü