Hmm, anhaltende Stille unter den Experten ...
Ist das Problem zu einfach oder zu schwierig, oder einfach nicht interessant genug?
Ich finde es sehr interessant und für mich allein zu schwierig!
Nach wie vor über jede Hilfe dankbar,
brambastel.
Um schreiben oder kommentieren zu können, benötigen Sie ein Benutzerkonto.
Sie haben schon ein Benutzerkonto? Melden Sie sich hier an.
Jetzt anmeldenHier können Sie ein neues Benutzerkonto erstellen.
Neues Benutzerkonto erstellenHmm, anhaltende Stille unter den Experten ...
Ist das Problem zu einfach oder zu schwierig, oder einfach nicht interessant genug?
Ich finde es sehr interessant und für mich allein zu schwierig!
Nach wie vor über jede Hilfe dankbar,
brambastel.
[TABLE="class: tborder, width: 100%, align: center"]
[tr]
[TD="class: alt1, bgcolor: #F5F5FF"]Liebe Zeitgenossen,
ich habe für meine Wordpress Seite ein Script für ein Dropdownmenü (für die Hauptnavigation in mobilen Browsern), welches auch fast ganz gut funktioniert. Man kommt zu allen Seiten - außer zur ersten.
Denn statt die aktuell aufgerufene Seite zu zeigen, zeigt es immer den ersten Menüpunkt an, was dazu führt, dass dieser nie anklickbar ist.
Hier der verantwortliche Code:
[TABLE="class: tborder, width: 100%, align: center"]
[tr]
[TD="class: alt1, bgcolor: #F5F5FF"][LEFT][COLOR=#000000][COLOR=#000000][COLOR=#FF8000]/* <![CDATA[ */
[/COLOR][COLOR=#007700]$([/COLOR][COLOR=#0000BB]document[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]ready[/COLOR][COLOR=#007700](function() {
$([/COLOR][COLOR=#DD0000]"#nav li"[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]hover[/COLOR][COLOR=#007700](function(){
$([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]find[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'ul:first'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]css[/COLOR][COLOR=#007700]({[/COLOR][COLOR=#0000BB]visibility[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#DD0000]"visible"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]display[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#DD0000]"none"[/COLOR][COLOR=#007700]}).[/COLOR][COLOR=#0000BB]show[/COLOR][COLOR=#007700]();
},function(){
$([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]find[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'ul:first'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]css[/COLOR][COLOR=#007700]({[/COLOR][COLOR=#0000BB]visibility[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#DD0000]"hidden"[/COLOR][COLOR=#007700]});
});
});
[/COLOR][COLOR=#FF8000]/* Code by Jeremy Hixon/Smashing mag */
[/COLOR][COLOR=#007700]$(function() {
[/COLOR][COLOR=#FF8000]/* Get the window's width, and check whether it is narrower than 480 pixels */
[/COLOR][COLOR=#007700]var [/COLOR][COLOR=#0000BB]windowWidth [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#0000BB]window[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]width[/COLOR][COLOR=#007700]();
if ([/COLOR][COLOR=#0000BB]windowWidth [/COLOR][COLOR=#007700]<= [/COLOR][COLOR=#0000BB]480[/COLOR][COLOR=#007700]) {
[/COLOR][COLOR=#FF8000]/* Clone our navigation */
[/COLOR][COLOR=#007700]var [/COLOR][COLOR=#0000BB]mainNavigation [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#DD0000]'.navwrap'[/COLOR][COLOR=#007700]).clone();
[/COLOR][COLOR=#FF8000]/* Replace unordered list with a "select" element to be populated with options, and create a variable to select our new empty option menu */
[/COLOR][COLOR=#007700]$([/COLOR][COLOR=#DD0000]'.navwrap'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]html[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'<select class="menu"></select>'[/COLOR][COLOR=#007700]);
var [/COLOR][COLOR=#0000BB]selectMenu [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#DD0000]'select.menu'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#FF8000]/* Navigate our nav clone for information needed to populate options */
[/COLOR][COLOR=#007700]$([/COLOR][COLOR=#0000BB]mainNavigation[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'ul'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'li'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]each[/COLOR][COLOR=#007700](function() {
[/COLOR][COLOR=#FF8000]/* Get top-level link and text */
[/COLOR][COLOR=#007700]var [/COLOR][COLOR=#0000BB]href [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'a'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]attr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'href'[/COLOR][COLOR=#007700]);
var [/COLOR][COLOR=#0000BB]text [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'a'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]text[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#FF8000]/* Append this option to our "select" */
[/COLOR][COLOR=#007700]$([/COLOR][COLOR=#0000BB]selectMenu[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]append[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'<option value="'[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]href[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#DD0000]'">'[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]text[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#DD0000]'</option>'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#FF8000]/* Check for "children" and navigate for more options if they exist */
[/COLOR][COLOR=#007700]if ($([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'ul'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]length [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]) {
$([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'ul'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'li'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]each[/COLOR][COLOR=#007700](function() {
[/COLOR][COLOR=#FF8000]/* Get child-level link and text */
[/COLOR][COLOR=#007700]var [/COLOR][COLOR=#0000BB]href2 [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'a'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]attr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'href'[/COLOR][COLOR=#007700]);
var [/COLOR][COLOR=#0000BB]text2 [/COLOR][COLOR=#007700]= $([/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]children[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'a'[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]text[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#FF8000]/* Append this option to our "select" */
[/COLOR][COLOR=#007700]$([/COLOR][COLOR=#0000BB]selectMenu[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]append[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'<option value="'[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]href2[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#DD0000]'">--- '[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]text2[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#DD0000]'</option>'[/COLOR][COLOR=#007700]);
});
}
});
}
[/COLOR][COLOR=#FF8000]/* When our select menu is changed, change the window location to match the value of the selected option. */
[/COLOR][COLOR=#007700]$([/COLOR][COLOR=#0000BB]selectMenu[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]change[/COLOR][COLOR=#007700](function() {
[/COLOR][COLOR=#0000BB]location [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]selectedIndex[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#0000BB]value[/COLOR][COLOR=#007700];
});
});
[/COLOR][COLOR=#FF8000]/* ]]> */ [/COLOR][/COLOR][/COLOR][/LEFT]
[/TD]
[/tr]
[/TABLE]
[/TD]
[/TABLE]
Es ist ja alles sehr schön kommentiert und auch übersichtlich gemacht, dennoch finde ich (wohl mangels ausreichender Kenntnis der Materie) den Fehler nicht.
Mit lieben Grüßen,
brambastel.