Skip to content

Undefined property with jQuery 1.3.2 #95

Closed

Description

@awaer

When setting the demo site to jQuery 1.3.2, I receive this error:

Line 419:
w = base.panelSize[page][0],

jquery.anythingslider.js:419Uncaught TypeError: Cannot read property '0' of undefined

Activity

  1. Mottie commented on May 25, 2011

    @Mottie
    Contributor

    Hi Awaer!

    The demo page is using the latest version of AnythingSlider which only supports jQuery 1.4+ as stated in the last line of the "Features" on the main demo page. If you want to make AnythingSlider work with version 1.3.2, you'll need to un-comment out the last section of the non-compressed script (it's not even in the compressed version)

    As for the jsFiddle working with the newest expand option, I haven't been able to get it to work there, but it works fine on my desktop... I'll try to figure out why it doesn't work there.

  2. Mottie commented on May 25, 2011

    @Mottie
    Contributor

    I stand corrected... I just switched a selector in the last update that I discovered wasn't added until jQuery 1.4. I'll fix it in the next update. If you need it now, just change line 201 and 206 from this:

    // line 201
    base.$el.prepend( base.$items.last().clone().addClass('cloned').removeAttr('id') );
    // line 206
    base.$el.append( base.$items.first().clone().addClass('cloned').removeAttr('id') );

    to this:

    // line 201
    base.$el.prepend( base.$items.filter(':last').clone().addClass('cloned').removeAttr('id') );
    // line 206
    base.$el.append( base.$items.filter(':first').clone().addClass('cloned').removeAttr('id') );
  3. Mottie commented on May 26, 2011

    @Mottie
    Contributor

    Fixed in version 1.5.17

  4. matiazar commented on Jun 8, 2011

    @matiazar

    I have the same problem... and im using Jquery version 1.4.3 and I have updated to 1.5.17

    when there is only one panel I got this error:
    base.panelSize[page] is undefined
    w = base.panelSize[page][0], line 419

  5. JoeM05 commented on Apr 6, 2012

    @JoeM05

    I get the same error when I have 0 frames in the slider,
    I'm using jquery 1.7 and anythinglister v 1.7.16

    Uncaught TypeError: Cannot read property '0' of undefined
    jquery.anythingslider.js:445 - w = base.panelSize[page][0]

  6. Mottie commented on Apr 6, 2012

    @Mottie
    Contributor

    Hmm, ok I'll look into it.

  7. reopened this on Apr 6, 2012
  8. hjujah commented on Apr 25, 2012

    @hjujah

    Same problem here with jquery 1.7.1 ...

  9. hjujah commented on Apr 27, 2012

    @hjujah

    Well here is my solution... As the problem occurs only if there are less then 2 slides, I just call the plugin if its not that case.
    for example :

                                                if(newSlide.objects.length>1){
                            $("#slider"+newSlide.id).anythingSlider({
                            resizeContents : true,
                            buildArrows: false,
                            toggleControls: false,
                            buildStartStop: false,
                            easing: 'easeInOutExpo',
                            animationTime: 800,
                            addWmodeToObject    : 'transparent',
                            navigationFormatter : function(i, panel){ // add thumbnails as navigation links
                                var thumb = panel.attr('thumb');
                                return '<img src="'+thumb+'">';
                            }
                        }); 
    

    And the html :
    if(count($obs)>1){ //obs are the objects for slider

                                    <!-- ANYTHING SLIDER GOES HERE-->
                                 }else{
    
                                          //this is the case if the object is image, same thing for videos...
                                       <div style="position: absolute; left: 50%;">
                                                   <div style="position: relative; left: -50%;">
                                                      <img class='slika' src="img/works/Projects/<?php echo $obj->value;  ?>"> 
                           </div>
                                       </div>
                               }
    

    NOTE : php tags are missing in html part of code

  10. Mottie commented on Apr 27, 2012

    @Mottie
    Contributor

    I actually have this fixed in the code... I'll be pushing a new version here in about 30 min or less :)

  11. Mottie commented on Apr 27, 2012

    @Mottie
    Contributor

    Ok, I just pushed out version 1.8 and I believe this bug has been eradicated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions