1

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

    });
});
UserX
  • 1,295
  • 7
  • 25
  • 39
  • Is IE reporting any errors? – j08691 Sep 02 '14 at 17:10
  • 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 Sep 02 '14 at 17:15
  • I click f12 and see the console on localhost now, and I dont get any error. – UserX Sep 02 '14 at 17:16
  • On google chrome sometimes I need also to refresh page so the plugins start working! – UserX Sep 02 '14 at 17:57
  • http://stackoverflow.com/questions/23891878/jquery-cycle-not-working-in-ie8-ie10 Maybe a step in the right direction. – David Scott Sep 05 '14 at 15:59
  • Have you seen this question? http://stackoverflow.com/questions/8218894/ie-9-script-error-script438-object-doesnt-support-property-or-method-addevent might be useful? – Roko C. Buljan Sep 05 '14 at 16:00
  • Thanks David Scott, but my images already have a height and width. – UserX Sep 05 '14 at 16:04
  • Yes, I already read about a solution changing browser mode to IE10. But also dont solve this problem! – UserX Sep 05 '14 at 16:07
  • any possibility to move your – David Scott Sep 05 '14 at 16:14
  • I have run into issues where if I add my – David Scott Sep 05 '14 at 16:15
  • Thanks again David Scott. But dont works. What a really strange issue!! – UserX Sep 05 '14 at 16:49
  • 1
    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 Sep 05 '14 at 18:21
  • My mistake, thanks for notice that JFK. – UserX Sep 05 '14 at 19:35
  • Have you tried `` (in your `` tag)? ... also, could you elaborate what "they don't work" means? errors in the lower-left corner of your IE browser? loading other plugins? any cms? any frameworks (bootstrap, normalize, etc) Could you provide a link to the page with the issue? otherwise it will be VERY difficult yo guess all possible causes of the issue – JFK Sep 07 '14 at 19:23
  • If your code works locally in IE, it will work remotely too, if all of your paths are correct. If the paths aren't correct, it won't work in any browser. So far, the way you explained this issue describes a scenario that simply won't occur, please expand on how your code is organized and where the error is occuring. If you are getting the error `property 'cycle' of `$` is undefined`, you should be getting other errors before that too. – Kevin B Sep 09 '14 at 14:39

4 Answers4

0

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.

Macsupport
  • 5,406
  • 4
  • 29
  • 45
0

try this

(function($) {
    $('#carosel').jCarouselLite({
        vertical: true,
        auto: 5000,
        speed: 2000,
        visible: 4
    });
})(jQuery);
ug_
  • 11,267
  • 2
  • 35
  • 52
MagicSux
  • 382
  • 3
  • 11
0

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

Kristófer
  • 95
  • 4
-1

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',
  })       
})
Mindastic
  • 4,023
  • 3
  • 19
  • 20
  • Thank you Mindastic, but also dont works. I already try that before because I also found some people saying thay problem about "," at the end. – UserX Sep 05 '14 at 16:10
  • Thats a long fixed issue, fixed with ES5 http://stackoverflow.com/a/7246662/1517919 – megawac Sep 05 '14 at 16:10