SitePoint Sponsor

User Tag List

Results 1 to 23 of 23
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    J-Query cycle plugin

    I'm making a site at bomamfg.com

    I'm having some issues with the J-Query cycle plugin. It works in IE and Firefox, but I can't get it to work in chrome. Any assistance would be greatly appreciated.

    bomamfg.com/Materials.html (click the Recycled Glass link)

    I have a feeling its something to do with the other Jquery I have running on the page as it works fine if it is run on its own separate page (wont see the images cycling through due to the linking being changed).

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Works fine in Google Chrome for me, try clearing your browser cache

  3. #3
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried that multiple times and it constantly fails.... can't figure it out

    I attached an image of what it looks like in chrome
    Attached Images Attached Images

  4. #4
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've also had 4 friends try it on there chromes and it hasn't worked on a single one (1 of them was a fresh install)

  5. #5
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what the javascript console in chrome says.

    see attach
    Attached Images Attached Images

  6. #6
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone able to help with this?

  7. #7
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    I's complaining that it can't find the swf objcet because the http://bomamfg.com/Materials/RecycledGlass.html page doesn't have a swf object.

    The other pages for Pewter, Crushed Marble, and Cold Cast Bronze do have an appropriate swf object, but the Recycled Glass page does not.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  8. #8
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    I's complaining that it can't find the swf objcet because the http://bomamfg.com/Materials/RecycledGlass.html page doesn't have a swf object.

    The other pages for Pewter, Crushed Marble, and Cold Cast Bronze do have an appropriate swf object, but the Recycled Glass page does not.
    Thanks for the reply!

    However I have already tried to remove the swf on all the pages, and see if it works then to no avail

  9. #9
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    The other pages seem to work correctly because they have the swf object in them.

    Have you tried ADDING the swf object to the Recycled Glass page, in the same way that it's there for the other pages?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  10. #10
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hum. I havnet tried that. i'll try that tonight.will post my results asap!

    however now that i have put more thought into it. i have deleted the swf object on the materials page which elimited that error. but didn't fix the cycle problem. will try your suggestion anyways

  11. #11
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't help at all

  12. #12
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found this today after fixing a different error

    Resource interpreted as script but transferred with MIME type text/html. jquery-1.4.2.js
    [cycle] terminating; zero elements found by selector jquery.cycle.all.2.72.js:33

    Not sure what to do about it though

  13. #13
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Then investigate why the nearly identical pages for Pewter, Crushed Marble, and Cold Cast Bronze work with no issue, yet the Recycled Glass one doesn't.

    Does Recycled Glass work when you replace it with one of the other pages?
    Yes: there's an issue with the content. No: the page can't be found.

    Remove parts of the now working (though wrong content) for Recycled Glass. Use the now-working page (though with wrong content) to find out what causes the gallery to work and to not work. Does it still work when you replace the heading? The information? Bring the original Recycled Glass headings and content in. Does it still work?

    This is all a part of the debugging process, something which you will be doing a lot of the time when you're a programmer.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  14. #14
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Then investigate why the nearly identical pages for Pewter, Crushed Marble, and Cold Cast Bronze work with no issue, yet the Recycled Glass one doesn't.

    Does Recycled Glass work when you replace it with one of the other pages?
    Yes: there's an issue with the content. No: the page can't be found.

    Remove parts of the now working (though wrong content) for Recycled Glass. Use the now-working page (though with wrong content) to find out what causes the gallery to work and to not work. Does it still work when you replace the heading? The information? Bring the original Recycled Glass headings and content in. Does it still work?

    This is all a part of the debugging process, something which you will be doing a lot of the time when you're a programmer.
    I think your misunderstanding the problem, I'm wanting to get rid of the flash all together (all the other pages, the pewter, etc) all are using flash, while the recycled glass page is using the Jquery cycle (what i'm trying to change them all to)

    So to say the other pages are "working" is not technically correct cause there different approaches.

  15. #15
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by edsters88 View Post
    Found this today after fixing a different error

    Resource interpreted as script but transferred with MIME type text/html. jquery-1.4.2.js
    That's just a warning. It's something you'll want to investigate later on, perhaps at our Server Management forum, but it doesn't stop jQuery from working as per normal.

    Quote Originally Posted by edsters88 View Post
    [cycle] terminating; zero elements found by selector jquery.cycle.all.2.72.js:33
    You have no gallery on the page until one of the links are clicked. Because the page has no gallery items when it loads, there will be zero elements found for the gallery, which is why you get that warning.

    It's not related to the problem that you're facing, though you later on may want to make your script a little bit smarter so that the situation doesn't occur. That would be for a different thread.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  16. #16
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    That's just a warning. It's something you'll want to investigate later on, perhaps at our Server Management forum, but it doesn't stop jQuery from working as per normal.



    You have no gallery on the page until one of the links are clicked. Because the page has no gallery items when it loads, there will be zero elements found for the gallery, which is why you get that warning.

    It's not related to the problem that you're facing, though you later on may want to make your script a little bit smarter so that the situation doesn't occur. That would be for a different thread.
    Gotcha, that makes sense.

  17. #17
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by edsters88 View Post
    I think your misunderstanding the problem, I'm wanting to get rid of the flash all together (all the other pages, the pewter, etc) all are using flash, while the recycled glass page is using the Jquery cycle (what i'm trying to change them all to)

    So to say the other pages are "working" is not technically correct cause there different approaches.
    Okay, now we're getting somewhere.

    Because the content is not on the page when the page loads, you cannot start the slideshow cycle process when the page loads.

    Instead, because the content is added to the page when the menu button us clicked, you need the slideshow cycle to occur after that content has loaded.

    The easiest way to do this is to use the jQuery live function, set perhaps to the load event for the slideshow.

    Failing that, you can update the script the loads the content, to start the slideshow process too.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  18. #18
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Okay, now we're getting somewhere.

    Because the content is not on the page when the page loads, you cannot start the slideshow cycle process when the page loads.

    Instead, because the content is added to the page when the menu button us clicked, you need the slideshow cycle to occur after that content has loaded.

    The easiest way to do this is to use the jQuery live function, set perhaps to the load event for the slideshow.

    Failing that, you can update the script the loads the content, to start the slideshow process too.
    Hum.. I believe I attempted to do this earlier however it failed, perhaps I did it incorrectly?

    I took my

    $('.slideshow').cycle({
    fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
    });

    and added it to my Css/materialNav.js like so
    Code JavaScript:
     
    $(document).ready(function(){
     
    //...........................................code above(same as this but different link
     
    $('#recycled').click(function(){
            var toLoad = "Materials/RecycledGlass.html";      
     
            $('#retail').fadeOut('fast',loadContent);     
     
     
            function loadContent() { 
                $('#retail').load(toLoad,'',showNewContent());
            }
            function showNewContent() {      
                $('#retail').fadeIn('normal');
            }
    $('.slideshow').cycle({
    		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    	});
    });
            return false;    
        });
    //   ................ some more of the same for a different link
    });

  19. #19
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Yeah, you know that showNewContent function? That's the one that runs once the new content on the page.

    With an Ajax request, that showNewContent doesn't actually occur until long after the script has completed.

    The upshot of this is that your showNewContent function will need to contain the slideshow code, or perhaps for better encapsulation, the showNewContent should trigger at the end of it a separate function that does the slideshow stuff itself.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  20. #20
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would placing
    Code JavaScript:
    $('.slideshow').cycle({
            fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        });
    });

    Inside the load content function solve this issue?

    Actually, shouldn't having the above code on the sheet thats being loaded solve this problem?, as the function will be called when the page is loaded? This would logically make sense to me (even though I'm rather bad at JS). Plus I still don't understand why it works in FF and IE lol

  21. #21
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by edsters88 View Post
    Actually, shouldn't having the above code on the sheet thats being loaded solve this problem?

    Try it out and see what happens.

    Plus I still don't understand why it works in FF and IE
    Nor do I at this stage, but at nearly 6am local time I'm being a very naughty boy for staying up so late.

    --
    Paul Wilkins
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  22. #22
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Nor do I at this stage, but at nearly 6am local time I'm being a very naughty boy for staying up so late.

    --
    Paul Wilkins
    Well you should get some sleep! I'm off to work now but will be checking these forums diligently after! thank you for helping me!

  23. #23
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Nor do I at this stage, but at nearly 6am local time I'm being a very naughty boy for staying up so late.

    --
    Paul Wilkins
    I have cleaned up my code on my materials page, and have removed the slide show code from it, now, the slide show code is on the page that is being loaded.

    It is still working in IE and FF, but is still failing in chrome. I thought this would work due to my scipt loading that page then showing it, so it should technically enable once the page (and hence the script) is fully loaded.

    However, as usall, its still failing


    I'm not sure if I stated this eariler, but if you hard code the page in the URL (http://bomamfg.com/Materials/RecycledGlass.html) the slide show works in chrome. I'm still leaning towards a conflict between the 2 scripts but have no idea how to test if thats the case or not.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •