1
votes

I'm working on http://www.aceaofmidland.com/ and I'm trying to use jQuery and jQuery.cycle to cycle through a wordpress custom post type that's marked up like so:

<div id="toolbar">
    <div id="home">
        <div id="arrows">
            <div class="prev"></div>
            <div class="next"></div>
        </div>
        <div id="descriptions">
            <div><strong>Second Home Alert Test</strong><br><p>Testing Testing Testing</p></div>
            <div><strong>Test Home Alert Title</strong><br><p>Test Content for homepage alert</p></div>
    </div>
    </div>
</div>

I'm using the following jQuery to try and activate the cycling. I'm positive I have the scripts correctly loaded, and in order too.

<script type="text/javascript">
    jQuery.noConflict();
    jQuery(function(){  
        jQuery('#descriptions').cycle({
            next: '.next',
            prev: '.prev',
            fx: 'fade',
            speed: 'fast',
            timeout: 5000,
            pause: 1
        });
    });
</script>

If anyone can find out how to get this to work, I'll be forever grateful. Thank you!

1

1 Answers

0
votes

In firebug I get the following errors on pageload:

jQuery.cookie is not a function
http://aceaofmidland.com/
Line 126

and

$j.cookie is not a function
http://aceaofmidland.com/wp-content/themes/trademark/files/js/theme.js?ver=3.2.1
Line 570

You may want to change this line:

if(undefined != jQuery.cookie('links-variant')) {

to

if('undefined' != typeof(jQuery.cookie('links-variant'))) {

https://developer.mozilla.org/en/JavaScript/Reference/Operators/Special/typeof

And that jQuery code should probably be wrapped in a $(document).ready(function () {}); wrapper.

I would always try to resolve all errors that occur before the code I am troubleshooting before altering the problematic code itself.