jQuery(window).load(function(){ jQuery(".photosgallery-vertical").sliderkit({ circular: true, mousewheel: false, shownavitems: 5, verticalnav: true, navclipcenter: true, auto: true, autospeed: 5000 }); jQuery("#gallery").sliderkit({ mousewheel: false, shownavitems: 4, panelbtnshover: true, auto: false, }); jQuery('.bubble').hover(function(){ // Hover over code var title = jQuery(this).attr('title'); var offset = jQuery(this).offset(); jQuery(this).data('tipText', title).removeAttr('title'); jQuery('
') .text(title) .appendTo('body') .fadeIn('fast') .css({ top: offset.top - 35, left: offset.left + 10 }); }, function() { // Hover out code jQuery(this).attr('title', jQuery(this).data('tipText')); jQuery('.tooltip').remove(); }); var max_height = 0; jQuery('.autoheight').each(function(e) { h = jQuery(this).height(); if(typeof(h) != "undefined") { if(h > max_height) { max_height = h; } } }); if(max_height > 0) { jQuery('.autoheight').height(max_height); } var max_height = 0; jQuery('.imgheight').each(function(e) { h = jQuery(this).height(); if(typeof(h) != "undefined") { if(h > max_height) { max_height = h; } } }); if(max_height > 0) { jQuery('.imgheight').height(max_height); } var max_height = 0; jQuery('.globalheight').each(function(e) { h = jQuery(this).height(); if(typeof(h) != "undefined") { if(h > max_height) { max_height = h; } } }); if(max_height > 0) { jQuery('.globalheight').height(max_height); } var max_height = 0; jQuery('.footheight').each(function(e) { h = jQuery(this).height(); if(typeof(h) != "undefined") { if(h > max_height) { max_height = h; } } }); if(max_height > 0) { jQuery('.footheight').height(max_height); } var max_height = 0; jQuery('.detailheight').each(function(e) { h = jQuery(this).height(); if(typeof(h) != "undefined") { if(h > max_height) { max_height = h; } } }); if(max_height > 0) { jQuery('.detailheight').height(max_height); } jQuery("#toggle").click(function(){ if( jQuery("#toggle").hasClass('toggle-out') ) { jQuery("#more_games").animate({"left": "-=150px"}, "slow"); jQuery("#toggle").addClass("toggle-in"); jQuery("#toggle").removeClass("toggle-out"); } else { jQuery("#more_games").animate({"left": "+=150px"}, "slow"); jQuery("#toggle").addClass("toggle-out"); jQuery("#toggle").removeClass("toggle-in"); } }); function loadRating() { jQuery( 'div.rating div.stars div.star' ).click(function() { var rate_id = jQuery( this ).parent('div.stars').attr('id'); var section_id = jQuery( this ).parent('div.stars').attr('name'); var get_size = jQuery( this ).parent('div.stars').attr('class'); var rate_size = get_size.split( '-' ); var get_value = jQuery( this ).attr('id'); var rate_value = get_value.split( '-' ); jQuery.ajax({ url: '/rating/?rateid='+rate_id+'&rateaction=vote&ratesection='+section_id+'&ratevalue='+rate_value[2]+'' }).done(function( msg ) { jQuery( 'div#rate-'+rate_id ).load( '/rating/?rateid='+rate_id+'&rateaction=get&ratesection='+section_id+'&ratesize='+rate_size[1]+'', function() { jQuery( 'div#rate-'+rate_id+' div#text' ).html( msg ); loadRating(); }); }); }); } loadRating(); var $container = jQuery('div.gallery'); // initialize $container.masonry({ columnWidth: 125, gutter: 7.5, transitionDuration: 0, itemSelector: 'a' }); // Social Media Header jQuery('#social div.fatwgo div.switch').on( "click", function() { var social = jQuery(this).attr('id'); if( jQuery.cookie('spielautomaten-fm_'+social) != 'true' ) { jQuery(this).addClass('active'); jQuery(this).parent().children('div.box').addClass('active'); jQuery(this).parent().children('div.box').load('/header_'+social+'/'); jQuery.cookie('spielautomaten-fm_'+social, 'true', { expires: 7, domain: 'spielautomaten.fm' }); } else { jQuery(this).removeClass('active'); jQuery(this).parent().children('div.box').removeClass('active'); jQuery(this).parent().children('div.box').children('div.inner').remove(); jQuery.cookie('spielautomaten-fm_'+social, 'false', { expires: 7, domain: 'spielautomaten.fm' }); } }); if( jQuery.cookie('spielautomaten-fm_facebook') == 'true' ) { var where = 'div#social div.fatwgo div#facebook' jQuery(where).addClass('active'); jQuery(where).parent().children('div.box').addClass('active'); jQuery(where).parent().children('div.box').load('/header_facebook/'); jQuery.cookie('spielautomaten-fm_facebook', 'true', { expires: 7, domain: 'spielautomaten.fm' }); } if( jQuery.cookie('spielautomaten-fm_twitter') == 'true' ) { var where = 'div#social div.fatwgo div#twitter' jQuery(where).addClass('active'); jQuery(where).parent().children('div.box').addClass('active'); jQuery(where).parent().children('div.box').load('/header_twitter/'); jQuery.cookie('spielautomaten-fm_twitter', 'true', { expires: 7, domain: 'spielautomaten.fm' }); } if( jQuery.cookie('spielautomaten-fm_googleplus') == 'true' ) { var where = 'div#social div.fatwgo div#googleplus' jQuery(where).addClass('active'); jQuery(where).parent().children('div.box').addClass('active'); jQuery(where).parent().children('div.box').load('/header_googleplus/'); jQuery.cookie('spielautomaten-fm_googleplus', 'true', { expires: 7, domain: 'spielautomaten.fm' }); } // Social Media Sidebar jQuery('div.sidebox div.facebook div.switch').on( "click", function() { if( jQuery.cookie('spielautomaten-fm_facebook-sidebar') != 'true' ) { jQuery(this).addClass('active'); jQuery(this).parent().children('div.box').addClass('active'); jQuery(this).parent().children('div.box').load('/sidebar_facebook/'); jQuery.cookie('spielautomaten-fm_facebook-sidebar', 'true', { expires: 7, domain: 'spielautomaten.fm' }); } else { jQuery(this).removeClass('active'); jQuery(this).parent().children('div.box').removeClass('active'); jQuery(this).parent().children('div.box').children('div.inner').remove(); jQuery.cookie('spielautomaten-fm_facebook-sidebar', 'false', { expires: 7, domain: 'spielautomaten.fm' }); } }); if( jQuery.cookie('spielautomaten-fm_facebook-sidebar') == 'true' ) { var where = 'div.sidebox div.facebook div.switch'; jQuery(where).addClass('active'); jQuery(where).parent().children('div.box').addClass('active'); jQuery(where).parent().children('div.box').load('/sidebar_facebook/'); jQuery.cookie('spielautomaten-fm_facebook-sidebar', 'true', { expires: 7, domain: 'spielautomaten.fm' }); } // Social Media Comments jQuery('div#comments div.switch').on( "click", function() { jQuery(this).addClass('active'); jQuery(this).parent().children('div.box').addClass('active'); jQuery(this).parent().children('div.box').children('div.info').hide(); jQuery(this).parent().children('div.box').children('div.script').load('/comments_facebook/'); jQuery.cookie('spielautomaten-fm_facebook-comments', 'true', { expires: 7, domain: 'spielautomaten.fm' }); }); if( jQuery.cookie('spielautomaten-fm_facebook-comments') == 'true' ) { var where = 'div#comments div.switch'; jQuery(where).addClass('active'); jQuery(where).parent().children('div.box').addClass('active'); jQuery(where).parent().children('div.box').children('div.info').hide(); jQuery(where).parent().children('div.box').children('div.script').load('/comments_facebook/'); jQuery.cookie('spielautomaten-fm_facebook-comments', 'true', { expires: 7, domain: 'spielautomaten.fm' }); } jQuery('form#search input').on( "focus", function() { jQuery( this ).val(''); }); jQuery('form#search').submit( function() { var query = jQuery('form#search input').val(); location.href="http://spielautomaten.fm/suche/"+query+"/"; return false; }); jQuery('#searchform form input').on( "focus", function() { jQuery( this ).val(''); }); jQuery('#searchform form').submit( function() { var query = jQuery('#searchform form input').val(); location.href="http://spielautomaten.fm/suche/"+query+"/"; return false; }); jQuery( "body" ).on( "keydown", function( event ) { var url = false; if( event.which == 37 ) { url = jQuery( 'div.detail_img div.prev a' ).attr( 'href' ); } else if( event.which == 39 ) { url = jQuery( 'div.detail_img div.next a' ).attr( 'href' ); } if( url ) { window.location = url; } }); jQuery( 'div.playdemo' ).on( 'click', function( event ) { var iframe_src = jQuery( this ).attr('data-game'); var link_url = jQuery( this ).attr('data-link'); var goto_url = jQuery( this ).attr('data-goto'); var bonus = jQuery( this ).attr('data-bonus')+'€'; var iframe = ''; /* '