Revision 621ed30a
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
templates/webpages/menu/menu.html | ||
---|---|---|
11 | 11 |
[%- END %] |
12 | 12 |
</div> |
13 | 13 |
<script type='text/javascript'> |
14 |
function make_img(i){ |
|
15 |
var img=$('<img>'); |
|
16 |
$.each(i, function(k,v){ img.attr(k,v) }); |
|
17 |
return img; |
|
18 |
} |
|
19 |
function make_menu_item(b){ |
|
20 |
var span1 = $('<span class="mii ms">').append(make_img(b.img)); |
|
21 |
var span2 = '<span class="mic">' + b.label + '</span>'; |
|
22 |
var a = $('<a class="ml">').append(span1, span2); |
|
23 |
if (b.href) a.attr('href', b.href); |
|
24 |
if (b.target) a.attr('target', b.target); |
|
25 |
var mi = $('<div class="mi">').addClass(b.cl).addClass(b.spacer).attr('id', b.item_id).append(a); |
|
26 |
$('#html-menu').append(mi); |
|
27 |
} |
|
14 | 28 |
$(function(){ |
15 | 29 |
$('#html-menu div.i, #html-menu div.sm').hide(); |
16 | 30 |
$('#html-menu div.m').each(function() { |
Auch abrufbar als: Unified diff
Experimentelles clientseitiges menuitem generator script