2

So continuing my jQuery efforts using the Cycle plugin, i have a new error.

erros says Line 274 of my jquery-1.3.2.min.js file, which is this section here:

after: function() {
        return this.domManip(arguments, false, function(elem){
            this.parentNode.insertBefore( elem, this.nextSibling );
        });
    },

I am assuming that is caused by my cycle function used on the page:

<script type="text/javascript"> 
$(function() {
    $('.slideshow').after('<div id="mininav" class="mininav">').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 5500,
    pause: 1,
        pager:  '#mininav',
        before: function() { if (window.console) console.log(this.src); }
    });


});
</script>

This script sits above the HTML:

<div class="tabContainer slideshow">


                <iw_iterate list="dcr.home.slideshow" var ='slideshow'>
                <![CDATA[


                <div class="tab current" style="background:#fff url({iw_value name='slideshow.image'/}) no-repeat top left;">
                    <div class="copy">
                    <h2>{iw_value name='slideshow.headline'/}</h2>
                    <p>{iw_value name='slideshow.text'/}</p>            
                    </div>
                </div>

                ]]></iw_iterate><![CDATA[


            </div><!--/tabContainer-->

I was able to utilze this script on another page, but i am wondering if it has to do with the dynamic iteration i use from my content management sytem, that creates the ".slideshow" divs based on how many entries i have in my visual editor...? BWAHHHH

Robik
  • 6,047
  • 4
  • 31
  • 41
tony noriega
  • 7,523
  • 17
  • 53
  • 72

2 Answers2

0

Try closing the div tag which you are creating:

.after('<div id="mininav" class="mininav"/>')

or:

.after('<div id="mininav" class="mininav"></div>')
karim79
  • 339,989
  • 67
  • 413
  • 406
0

EDIT:

Not sure what exactly your issue is, but here is a working jsFiddle demo.

Code Maverick
  • 20,171
  • 12
  • 62
  • 114
  • Ok, so this is what makes me literally crazy... i changed .after to .before and it works in IE8 on my PC. Same PC using FireFox doesnt work, but i can see it creating the "mininav" div in the source code. Same PC with Chrome, and instead of showing 2 iterations of ".slideshow" div, it is creating 4, same thing on my MAC with FireFox.. so somehow it is on Chrome and MAC FF, it is creating 2 iterations for every 1 that i enter in my visual editor...the loop seems off... WTF? – tony noriega Apr 13 '11 at 15:25
  • @tony - 1) Are you trying to apply the cycle() to .slideshow div or the newly created .mininav div? 2) Are you using the latest version of the cycle plugin as well as the latest version of jQuery that the cycle plugin uses? – Code Maverick Apr 13 '11 at 16:11
  • I am trying to apply cycle() to .slideshow, and the .before is for mininav to create the mini navigation above the .slideshow. – tony noriega Apr 13 '11 at 16:54
  • I know...its kiling me. So i went into FireBug and found an error: Failed to load source for http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js - Any Idea as to why that would occur? Im using FireFox 3.6.3 – tony noriega Apr 13 '11 at 19:52