Advertisement
Eckstein

Untitled

Jan 11th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.00 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * The template used for displaying page content in page.php
  5.  *
  6.  * @package WordPress
  7.  * @subpackage Twenty_Eleven
  8.  * @since Twenty Eleven 1.0
  9.  */
  10. ?>
  11.  
  12. <div id="spf-top">
  13.     <div id="image">
  14.     <?php echo wp_get_attachment_image(get_field('spf_image'), 'single-featured-square'); ?>
  15.     </div>
  16.    
  17.     <div id="top-tabs">
  18.         <ul>
  19.             <?php
  20.             if (get_field('spf_top_menu')) {
  21.                     $cnt=1;
  22.                     $tabcontent = array();
  23.                 while (has_sub_field('spf_top_menu')) {
  24.                     $tabid = 'tab-'.$cnt;
  25.                     $tabcontent[] = get_sub_field('tab_content');
  26.                     echo '<li id="'.$tabid.'">';
  27.                     //echo '<a href=""></a>';
  28.                     the_sub_field('menu_item');
  29.                     echo '</li>';
  30.                     $cnt++;
  31.                 }
  32.             }
  33.             ?>
  34.         </ul>
  35.         <div id="top-tabs-content"> <?php echo $tabcontent[0]; ?> </div>
  36.         <script>
  37.         $(function() {
  38.         $('#tab-1').click(function() {
  39.             alert('click event called!'); var tabcontent = "'" + "<?php echo $tabcontent[0];?>" + "'";
  40.             document.getElementById('top-tabs-content').innerHTML = tabcontent;
  41.         });
  42.         });
  43.  
  44.         $(function() {
  45.         $('#tab-2').click(function() {
  46.           alert('click event called!'); var tabcontent = "'" + "<?php echo $tabcontent[1];?>" + "'";
  47.             document.getElementById('top-tabs-content').innerHTML = tabcontent;
  48.         });
  49.         });
  50.  
  51.         $(function() {
  52.         $('#tab-3').click(function() {
  53.           alert('click event called!'); var tabcontent = "'" + "<?php echo $tabcontent[2];?>" + "'";
  54.             document.getElementById('top-tabs-content').innerHTML = tabcontent;
  55.         });
  56.         });
  57.  
  58.         $(function() {
  59.         $('#tab-4').click(function() {
  60.         alert('click event called!'); var tabcontent = "'" + "<?php echo $tabcontent[3];?>" + "'";
  61.             document.getElementById('top-tabs-content').innerHTML = tabcontent;
  62.         });
  63.         });
  64.  
  65.         $(function() {
  66.         $('#tab-5').click(function() {
  67.         alert('click event called!');  var tabcontent = "'" + "<?php echo $tabcontent[4];?>" + "'";
  68.             document.getElementById('top-tabs-content').innerHTML = tabcontent;
  69.         });
  70.         });
  71.         </script>
  72.        
  73.     </div>
  74. <div style="clear:both;"></div>
  75. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement