Created
August 23, 2012 14:28
-
-
Save Quby/3437156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> | |
<!-- Display the title on all pages except for the home page --> | |
<?php if ( !is_front_page() ) { ?> | |
<h2><?php the_title(); ?></h2> | |
<?php } ?> | |
<!-- Wrap a div around certain pages --> | |
<?php if ( is_page(238) ) { ?> | |
<div id="faqs-page"> | |
<?php the_content(); ?> | |
</div> | |
<?php } else { ?> | |
<?php the_content(); ?> | |
<?php } ?> | |
<!-- If you're on the home page, call these WP-Blocks --> | |
<?php if ( is_page(234) ) { ?> | |
<?php get_wp_block('home-intro'); ?> | |
<?php get_wp_block('breakfast'); ?> | |
<div id="spotlight" > | |
<ul> | |
<li><a href="#" rel="haines" class="selected">Jim Haines</a></li> | |
<li><a href="#" rel="loren">Loren Keim</a></li> | |
<li><a href="#" rel="donna">Donna Hosfeld</a></li> | |
<li><a href="#" rel="larry">Larry Delhagen</a></li> | |
</ul> | |
<div class="panel active" id="haines" > | |
<h2>Jim Haines </h2> | |
<p>Owner of Haines Exxon, and current chapter President.</p> | |
</div> | |
<div class="panel" id="loren" style="display: none;"> | |
<h2>Loren Keim</h2> | |
<p>A member of LeTip of the Lehigh Valley talks housing.</p> | |
</div> | |
<div class="panel" id="donna" style="display: none;"> | |
<h2>Donna Hosfeld from Hosfeld Insurance</h2> | |
<p>Founded Hosfeld Insurance in June 1998.</p> | |
</div> | |
<div class="panel" id="larry" style="display: none;"> | |
<h2>Larry Delhagen</h2> | |
<p>Larry has been a financial advisor for 15 years.</p> | |
</div> | |
</div> | |
<script type="text/javascript"> | |
var timeoutId; | |
function emulateClick () { | |
$('#spotlight ul li a').click(); // so we emulate click on element | |
} | |
$(document).ready(function() { | |
$('#spotlight ul li a').click(function() { | |
if (timeoutId) { | |
clearTimeout(timeoutId); | |
// if user clicked when we reset timeout | |
} | |
$('#spotlight ul li a:not('+ this +')').removeClass('selected'); | |
$(this).addClass('selected'); | |
var currentPanel = $('.active'); | |
var nextPanelID = '#' + $(this).attr('rel') + ''; | |
var nextPanel = $(nextPanelID); | |
var animationSpeed = 300; | |
currentPanel.fadeOut(animationSpeed, function() { | |
currentPanel.removeClass('active'); | |
nextPanel.addClass('active'); | |
nextPanel.fadeIn(animationSpeed); | |
setTimeout(emulateClick, 3000); | |
//and create new after animation end | |
}); | |
return false; | |
}); | |
setTimeout(emulateClick, 3000); // and initialistion timeout | |
}); | |
</script> | |
<?php } ?> | |
<?php endwhile; ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment