/* imgsizer (flexible images for fluid sites) */ var imgSizer={Config:{imgCache:[],spacer:"/path/to/your/spacer.gif"},collate:function(aScope){var isOldIE=(document.all&&!window.opera&&!window.XDomainRequest)?1:0;if(isOldIE&&document.getElementsByTagName){var c=imgSizer;var imgCache=c.Config.imgCache;var images=(aScope&&aScope.length)?aScope:document.getElementsByTagName("img");for(var i=0;i 0) jQuery(thisObj).addClass('label label-default'); if (num == 2) jQuery(thisObj).addClass('label label-info'); if (num > 2 && num < 4) jQuery(thisObj).addClass('label label-success'); if (num >= 5 && num < 10) jQuery(thisObj).addClass('label label-warning'); if (num >=10) jQuery(thisObj).addClass('label label-important'); } } else jQuery(thisObj).addClass('label'); return true; } // as the page loads, call these scripts jQuery(document).load(function($) { resize_teaser(); }); jQuery(document).ready(function($) { // 1000°Digital Mod $(".owl_carousel").owlCarousel({ items: 3, itemsScaleUp: true, autoPlay: 15000 }); $(".slider").owlCarousel({ singleItem:true, itemsScaleUp: true, autoPlay: 15000, navigation: true, navigationText: ["", ""] }); $(".linkblock header").click(function() { $(this).next().slideToggle(); }); $('.accordion .item').not('.active').children("article").hide(); $(".accordion_header").click(function() { $(this).parent().addClass('active'); $(this).parent().children('article').slideDown(); $(this).parent().siblings().children('article').slideUp(); $(this).parent().siblings().removeClass('active'); setTimeout(function(){ $('html, body').animate({ scrollTop: ($('.item.active').offset().top - 100)}, 'slow'); },500); }); $('img[usemap]').rwdImageMaps(); $(".imagemap_click").click(function(e) { e.preventDefault(); var $href = $(this).attr("href"); $($href).click(); setTimeout(function(){ $('html, body').animate({ scrollTop: ($($href).offset().top - 100)}, 'slow'); },500); }); //höhe anpassen setTimeout(function() { resize_teaser(); }, 0); $( window ).resize(function() { resize_teaser(); }); // modify tag cloud links to match up with twitter bootstrap $("#tag-cloud a").each(function() { addTwitterBSClass(this); return true; }); $("p.tags a").each(function() { addTwitterBSClass(this); return true; }); $("ol.commentlist a.comment-reply-link").each(function() { $(this).addClass('btn btn-success btn-mini'); return true; }); $('#cancel-comment-reply-link').each(function() { $(this).addClass('btn btn-danger btn-mini'); return true; }); $('article.post').hover(function(){ $('a.edit-post').show(); },function(){ $('a.edit-post').hide(); }); // Input placeholder text fix for IE // $('[placeholder]').focus(function() { // var input = $(this); // if (input.val() == input.attr('placeholder')) { // input.val(''); // input.removeClass('placeholder'); // } // }).blur(function() { // var input = $(this); // if (input.val() == '' || input.val() == input.attr('placeholder')) { // input.addClass('placeholder'); // input.val(input.attr('placeholder')); // } // }).blur(); // Prevent submission of empty form $('[placeholder]').parents('form').submit(function() { $(this).find('[placeholder]').each(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); } }) }); // $('#s').focus(function(){ // if( $(window).width() < 940 ){ // $(this).animate({ width: '200px' }); // } // }); // $('#s').blur(function(){ // if( $(window).width() < 940 ){ // $(this).animate({ width: '100px' }); // } // }); $('.alert-message').alert(); $('.dropdown-toggle').dropdown(); }); function resize_teaser() { $width = jQuery(".first_leaf").width() / 970; jQuery(".first_leaf").height(($width * 380)); jQuery(".owl_carousel").each(function(e) { var max_height = 0; jQuery(this).find('article').each(function(f){ jQuery(this).attr("style", ""); h = jQuery(this).height(); if(typeof(h) != "undefined") { if(h > max_height) { max_height = h; } } }); if(max_height > 0) { max_height=max_height+20; jQuery(this).find('article').each(function(f){ jQuery(this).height(max_height); }); } }); }