...

View Full Version : jQuery Slider - Simple Code Issue?



Cheshire9
03-23-2012, 08:58 AM
Hello!

I've been fighting with a jQuery slider all day, and it's going nowhere because admittedly I have extremely limited jQuery knowledge. I am really hoping that someone here is better at this than I am and can tell me why I see a list of the items that should be in the slider stacked up on top of each other rather than seeing the actual slider. Here is the functions.php code. All CSS is in place, but I can copy/paste the stylesheet if necessary as well.

If this isn't an appropriate forum for this, can you point me in the right direction? I don't even know which way is up anymore!!!





<?php

/* HEADER SCRIPTS */
function headscript() {
global $post;

if (function_exists('is_products_page')){
if ( get_post_type() == 'wpsc-product' || is_products_page() )
return;

}
?>
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3270175-9']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript"

src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {

//Default Action
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content

//On Click Event
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});
});
</script>

<script type="text/javascript" src="http://www.claritymind.com/js/easySlider1.7.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#slider2").easySlider({
auto: true,
continuous: true,
pause: 6000,
speed: 800,
nextId: "slider1next",
prevId: "slider1prev"
});
});
</script>

<script type="text/javascript">
$(function () {
$('a#testbutton').hover(function() {
$(this).fadeTo("fast", 1);
}, function() {
$(this).fadeTo("fast", .85);
});
});
</script>

<script type="text/javascript">
$(document).ready(function(){
$("#slider1").easySlider({
numeric: true,
auto: true,
continuous: true,
pause: 9000,
speed: 700,
});
});
</script>
<?php }

/* PAGE SPECIFIC CSS TWEAKS */

function home_head() {
if (is_home() || is_front_page()) { ?>
<style type="text/css">
.custom .headline_area {display:none;}
</style>
<style type="text/css">
.custom .servnav {display:none;}
</style>
<?php } }


function nonhomepagecss(){
if (!is_home() && !is_front_page()) { ?>

<style type="text/css">
.custom #sidebars{margin-top:15px;background:none;}
body.custom {background-color:#f5f6f7;}
.custom #content_area {background-color: #F5F6F7;}
.custom .post_box{padding-top:30px;}
.custom #content_box{
margin: 30px auto;
width: 960px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: white;
box-shadow: 3px 3px 3px #CCC;
-moz-box-shadow: 3px 3px 3px #CCC;
-webkit-box-shadow: 3px 3px 3px #CCC;
border-top: 1px solid #E8E8E8;
border-left: 1px solid #E8E8E8;
font-family: 'Lucida Grande', 'Lucida Grande Unicode', Helvetica, Verdana, sans-serif;
padding-bottom: 30px;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
}
</style>
<?php } }

function new_servicespage() {
if (is_page('services') || is_page('30')) { ?>
<style type="text/css">
.custom .topnav {display:none;}
.custom .servnav {display:block;}
</style>

<div id="content">
<div class="post_box">
<div class="headline_area">
</div>
Example text will go here.
</div>
</div>
<div id="sidebars"><span class="newcallout1h4">
<table>
<tr>
<div style="vertical-align:top;">
<td width="275"><img src="http://cm.deviantwebdesign.com/wp-content/uploads/2012/03/VideoPlace.jpg" height="180" width="260">
</div>
<td width="330"><div style="margin-left: 30px;"> <font color="#000000" font size="4">HEADLINE TEXT</font>
<ul>
<font color="#000000" font size="3">
<li>Bullet 1 - Example text goes here.</li>
<li>Bullet 2. Ut enim ad minim veniam, quis nostrud exercitation.</li>
<li>Bullet 3. Duis aute irure dolor in reprehenderit in voluptate velit esse.</li>
</font>
</ul>
</div></td>
<td width="275"><div style="margin-left: 30px;">
<script type="text/javascript" src="//moon-ray.com/v2.4/include/formEditor/genjs.php?html=true&uid=p2c6497f5&version=1"></script>
</div></td>
</tr>
</table>
</span>
<?php thesis_build_sidebars(); ?>
</div>

<?php } }

add_action('thesis_hook_custom_template', 'new_servicespage');

/* NAVIGATION MENU */
function navmenuarea(){ ?>
<div class="topnav">
<div style="width:960px;margin-left:auto;margin-right:auto;">
<div style="float:left;">
<a href="http://claritymind.com/"><img alt="clrity-logo" src="http://www.claritymind.com/wp-content/uploads/2011/03/logosmall2.jpg" style="position:relative;left:0px;" /></a>
</div>
<div style="float:right;padding-top:11px;">
<ul id="navlist">
<li><a href="http://claritymind.com/services">Services</a></li>
<li><a href="http://claritymind.com/next-step">Next Steps</a></li>
<li><a href="http://claritymind.com/about">About</a></li>
<li><a href="http://claritymind.com/free-articles">Free Stuff</a></li>
<li><a href="http://claritymind.com/clients">Clients</a></li>
<li><a href="http://claritymind.com/events">Events</a></li>
<li><a style="color:#BCFC3D;" href="http://claritymind.com/products">Store</a></li>
</ul>
</div>
</div>
</div>


<?php }


/* FEATURED AREA */

function lowermenu(){
if (is_page()) { ?>
<div class="clear"></div>

<div style="width:100%;height:5px;"></div>

<div class="pagecentered">
<div class="newcallout1">
</div>
</div>
<div style="width:100%;height:15px;"></div>
<?php } }


/* REGISTER SIDEBARS FOR CUSTOM SIDEBARS */

if (function_exists('register_sidebar')) {
$sidebars = array(1,2, 3, 4, 5, 6, 7, 8, 9, 10);
foreach($sidebars as $number) {
register_sidebar(array(
'name' => 'Side ' . $number,
'id' => 'side-' . $number,
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
}

function sidebartabs(){
if (function_exists('is_products_page')){
if ( get_post_type() == 'wpsc-product' || is_products_page() )
return;

}


?>
<div style="width:100%;height:25px;"></div>

<div class="tabcontainer">
<ul class="tabs">
<li><a href="#tab1">Popular</a></li>
<li><a href="#tab2">Latest</a></li>
<li><a href="#tab3">Topics</a></li>
<li><a href="#tab4">Links</a></li>
</ul>
<div class="tab_container">
<div id="tab1" class="tab_content" style="padding-right:0px;">

<a href="http://www.claritymind.com/next-step/" style="border:0;padding:0;margin:0;"><img

src="http://www.claritymind.com/wp-content/uploads/2012/01/Master-Your-Mindset.png" alt="Change

Your Mindset with Clarity Mind Coaching" style="border:0;padding:0;margin:0;" /></a>
<div class="clear"></div>

</div>
<div id="tab2" class="tab_content">

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Side 6') ) :

?>
<?php endif; ?>

</div>
<div id="tab3" class="tab_content">

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Side 7') ) :

?>
<?php endif; ?>
<div class="clear"></div>

</div>
<div id="tab4" class="tab_content">

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Side 8') ) :

?>
<?php endif; ?>
</div>
</div>
</div>

<div class="clear"></div>

<?php }
add_action('thesis_hook_before_sidebars', 'sidebartabs');


function home_pagecustom() {
if (is_home() || is_page(4217)) { ?>


<div style="height:0px;width:0px;position:relative;left:294px;z-index:999;">
<div style="width:356px;height:1px;background:#efefef;"></div>
<div style="width:356px;padding-top:2px;"><span class="nqheading">Featured from the

Blog</span></div>
</div>

<div id="slider1">
<ul>

<?php query_posts($query_string . '&cat=-3,-8&posts_per_page=5'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<li>
<div class="post">

<div style="width:279px;margin-right:15px;float:left;">
<?php $post_image = thesis_post_image_info('image');
echo $post_image['output']; ?>
</div>

<div style="width:356px;float:right;padding-top:20px;">

<div style=height:300px;overflow:hidden;">
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php

the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<div class="entry">
<?php the_excerpt(); ?>
</div>

</div>
<div style="width:356px;height:2px;"></div>
<span class="readstory"><a href="<?php the_permalink() ?>" rel="bookmark" title="Continue

Reading <?php the_title_attribute(); ?>">Continue Reading Post &rarr;</a>

</div>
<div class="clear"></div>

</div> <!-- closes the first div box -->

</li>

<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>

</ul>
</div><!-- close slider1 -->



<?php wp_reset_query(); ?>

<div style="width:650px;margin-top:10px;">
<div class="one_third">
<div style="width:100%;height:1px;background:#efefef;"></div>
<div style="width:100%;padding-top:2px;"><span class="nqheading">Lifestyle Design</span></div>

<div style="width:199px;height:10px;"></div>
<?php query_posts($query_string . '&cat=37&posts_per_page=3'); ?>

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 1) : ?>

<?php $post_image = thesis_post_image_info('thumb');echo $post_image['output']; ?>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span class="teaserexcerpt"><?php the_excerpt(); ?></span>

<?php else : ?>
<div style="width:199px;height:1px;border-top:1px dotted #cecece;margin-top:5px;"></div>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<?php wp_reset_query(); ?>

</div>
<div class="one_third">
<div style="width:100%;height:1px;background:#efefef;"></div>
<div style="width:100%;padding-top:2px;"><span class="nqheading">Love & Relationships</span></div>

<div style="width:199px;height:10px;"></div>
<?php query_posts($query_string . '&cat=39&posts_per_page=3'); ?>

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 1) : ?>

<?php $post_image = thesis_post_image_info('thumb');echo $post_image['output']; ?>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span class="teaserexcerpt"><?php the_excerpt(); ?></span>

<?php else : ?>
<div style="width:199px;height:1px;border-top:1px dotted #cecece;margin-top:5px;"></div>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<?php wp_reset_query(); ?>

</div>
<div class="one_third last">
<div style="width:100%;height:1px;background:#efefef;"></div>
<div style="width:100%;padding-top:2px;"><span class="nqheading">Personal Growth</span></div>
<div style="width:199px;height:10px;"></div>
<?php query_posts($query_string . '&cat=226&posts_per_page=3'); ?>

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 1) : ?>

<?php $post_image = thesis_post_image_info('thumb');echo $post_image['output']; ?>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span class="teaserexcerpt"><?php the_excerpt(); ?></span>

<?php else : ?>
<div style="width:199px;height:1px;border-top:1px dotted #cecece;margin-top:5px;"></div>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<?php wp_reset_query(); ?>

</div>

<div class="clear"></div>

</div>

<div class="newcallout">
<h4 class="newcallouth4"><a href="http://www.claritymind.com/soul-affirmation-music-for-better-outcomes/">Browse Affirmation Music for Sale!</a></h4>
</div>


<div style="width:650px;margin-top:30px;">
<div class="one_third">
<div style="width:100%;height:1px;background:#efefef;"></div>
<div style="width:100%;padding-top:2px;"><span class="nqheading">Awareness</span></div>

<div style="width:199px;height:10px;"></div>
<?php query_posts($query_string . '&cat=15&posts_per_page=3'); ?>

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 1) : ?>

<?php $post_image = thesis_post_image_info('thumb');echo $post_image['output']; ?>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span class="teaserexcerpt"><?php the_excerpt(); ?></span>

<?php else : ?>
<div style="width:199px;height:1px;border-top:1px dotted #cecece;margin-top:5px;"></div>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<?php wp_reset_query(); ?>


</div>
<div class="one_third">
<div style="width:100%;height:1px;background:#efefef;"></div>
<div style="width:100%;padding-top:2px;"><span class="nqheading">Meditation</span></div>

<div style="width:199px;height:10px;"></div>
<?php query_posts($query_string . '&cat=40&posts_per_page=3'); ?>

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 1) : ?>

<?php $post_image = thesis_post_image_info('thumb');echo $post_image['output']; ?>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span class="teaserexcerpt"><?php the_excerpt(); ?></span>

<?php else : ?>
<div style="width:199px;height:1px;border-top:1px dotted #cecece;margin-top:5px;"></div>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<?php wp_reset_query(); ?>

</div>
<div class="one_third last">
<div style="width:100%;height:1px;background:#efefef;"></div>
<div style="width:100%;padding-top:2px;"><span class="nqheading">Spirituality</span></div>
<div style="width:199px;height:10px;"></div>
<?php query_posts($query_string . '&cat=61&posts_per_page=3'); ?>

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 1) : ?>

<?php $post_image = thesis_post_image_info('thumb');echo $post_image['output']; ?>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span class="teaserexcerpt"><?php the_excerpt(); ?></span>

<?php else : ?>
<div style="width:199px;height:1px;border-top:1px dotted #cecece;margin-top:5px;"></div>
<h2 class="teasertitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php endif; ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<?php wp_reset_query(); ?>

</div>


<div class="clear"></div>

<br /><br /><br /><br />
</div>

<?php } }
add_action('thesis_hook_before_content', 'home_pagecustom');


/* CUSTOM FOOTER */
function newfooter(){ ?>
<div style="width:100%;height:80px;"></div>
<div style="width:100%;background:#000000;" class="footernew1">
<div style="width:100%;height:0px;position:relative;top:-132px;z-index:-1;">
<div style="background:url(http://www.claritymind.com/wp-content/uploads/2011/03/mountainback2.jpg) bottom repeat-x;height:132px;width:100%;"></div>
</div>
<div class="pagecentered" style="padding-top:15px;">
<div class="one_third">
<img src="http://www.claritymind.com/wp-content/uploads/2011/03/certification1.jpg" alt="certification" />
<div style="width:100%;height:3px;border-bottom:1px dotted #444;"></div>
<br />
<img src="http://www.claritymind.com/wp-content/uploads/2011/03/logosmall2.jpg" alt="Clarity Mind Logo" /><br />
20 Ravenscroft Drive Asheville, NC 28801<br />
404-NOW-MIND (404-669-6463)<br />
Skype: KenLad1
</div>
<div class="one_third">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Side 9') ) : ?>
<?php endif; ?>
</div>
<div class="one_third last">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Side 10') ) : ?>
<?php endif; ?>
</div>
<div class="clear"></div>
<div style="height:20px;width:100%;"></div>
<span style="font-size:10px;color:#fff;">Copyright &copy; Clarity Mind, LLC. All Rights Reserved. Reproduction without permission prohibited.</span>
</div>
</div>
<?php }

function format_gridview_desc($description){
if (strlen($description) > 175)
$description = substr ( $description , 0 , 175 )."...";
echo $description;
}

/* create new side bar for music player - this will only be displayed on the product page */
register_sidebar(array(
'name'=> 'Music Player',
'id' => 'music_player',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum