1
votes

Im using jQuery cycle and jcarousel plugins.

Theese plugins are working fine in localhost, but now I host my example in a free host service just to do some tests, and my jQuery plugins dont work in internet explorer. But they work in google chrome. Im using IE 10.

Do you know why this can be happening?

Im have my scripts import in my scripts.php file, and then I include this file in my page :

<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/cycle.js"></script>
<script type="text/javascript" src="scripts/cycle_function.js"></script>
<script type="text/javascript" src="scripts/shadowbox/shadowbox.js"></script>
<script type="text/javascript" src="scripts/shadobox_function.js"></script>
<script type="text/javascript" src="scripts/jcarousel.js"></script>
<script type="text/javascript" src="scripts/jcarousel_function.js"></script>

My cycle function:

$(function(){
  $("#last_news ul").cycle({
        fx:'fade',
        speed: 1500,
        timeout: 5000,
        pager: '#pager',
  })       
})

My jCarousel function:

$(function() {
    $("#carosel").jCarouselLite({
        vertical: 'true',
        auto: 5000,
        speed: 2000,
        visible: 4

    });
});
4
Is IE reporting any errors? - j08691
Thanks for your answer. Im not very familiar with internet explorer network tools, but when I click in f12, and then "console", Im geting this red message: "SCRIPT438: object dont support the proprierty and method 'cycle' cycle_function.js, line 2 char 3 - UserX
I click f12 and see the console on localhost now, and I dont get any error. - UserX
On google chrome sometimes I need also to refresh page so the plugins start working! - UserX
what is the difference between the cycle and jCarousel initialization scripts (apart from the selector and the trialing comma)? I must have missed something since I thought they were two different plugins - JFK

4 Answers

0
votes

A few errors in your script. You have not loaded the script jcarousellite.js but you use it on your page:

 $(function() {
 $("#carosel").jCarouselLite({
    vertical: 'true',
    auto: 5000,
    speed: 2000,
    visible: 4

 });
 }); 

I think you want this instead:

$(function() {
 $("#carosel").jcarousel({
    vertical: 'true',
    auto: 5000,
    speed: 2000,
    visible: 4

 });
 }); 

Make sure that your misspelling of '#carosel' is really the ID name., not #carousel.

You are not loading 'shadowbox_function.js' because you spelled it 'shadobox_function.js'

Other than that, one would need a link to your page. No way to tell other wise.

0
votes

try this

(function($) {
    $('#carosel').jCarouselLite({
        vertical: true,
        auto: 5000,
        speed: 2000,
        visible: 4
    });
})(jQuery);
0
votes

Okay, first off, You're forgetting to close the lines in the cycle function

So instead of:

$(function(){
  $("#last_news ul").cycle({
        fx:'fade',
        speed: 1500,
        timeout: 5000,
        pager: '#pager',
  })       
})

You'll need:

$(function(){
  $("#last_news ul").cycle({
        fx:'fade',
        speed: 1500,
        timeout: 5000,
        pager: '#pager',
  }); //<-- Added semi-colons ( ; ) here,
}); //<-- and here.

Also, best-practices wise, I'd recommend that you place all your custom js functions in a custom.js file, and run them from there. Just make sure to include it in your header.

IE is kind of strict on best practises.

Please look at the documentation on those plugins for more info, too. Thanks

-1
votes

I don't really know if this helps, but based on some experience, IE doesn't work well when you have a "," after the last array element, like you have in:

$(function(){
  $("#last_news ul").cycle({
        fx:'fade',
        speed: 1500,
        timeout: 5000,
        pager: '#pager',
  })       
})