Elements wont be created!
Does anyone know, why this Code does not create any of the elements (<li>, and <ul>)? Thank you! :)
- var makeTabs = {
- init: function(){
- var $pages = $("div.tabs");
- if(!$pages.lenght) return;
- $pages.addclass("dyn-tabs");
- $pages.first().show();
- var tabNavigation = $('<ul id="tabs" />')
- .insertBefore($pages.first());
- $pages.each(function(){
- var listElement = $("<li />");
- var label = $(this).attr("Neues") ?
- $(this).attr("Anfragen") :
- "Kein Label";
- listElement.text(label);
- tabNavigation.append(listElement);
- });
- var items = tabNavigation.find("li");
- items.first().addClass("current");
- items.click(function(){
- items.removeClass("current");
- $(this).addClass("current");
- $pages.hide();
- $pages.eq($(this).index()).fadeIn("slow");
- });
- }
- };
- $(document).ready(makeTabs.init);