JQuery not working in IE8?

I work on the site here: mfm.treethink.net All jquery works fine in Firefox, Chrome and Safari, but in IE8 it gives me errors, and the banner at the top does not work (which uses the crossSlide jQuery plugin), as well as rollover images does not work with color change.

IE8 tells me that the errors are on lines 53, 134 and 149 in the source, all of these lines contain a jquery function.

$(document).ready(function(){

I am running jquery 1.4. Oddly enough, the other jQuery piece that I have on this page works, the artist browses / selects the menu on the right. But scrolling banners and images do not.

Here are all the scripts that I run:

1: banner - not working in IE8

<script type="text/javascript">
  $(function() {
    $('#banner').crossSlide({
      sleep: 5,
      fade: 1
    }, [
      <?php
   $pages = get_posts('numberposts=2000&post_type=artist&post_status=publish');

   $i = 1;
   foreach( $pages as $page ) {
       $content = $page->post_title;
       if( empty($content) ) continue;

       $content = apply_filters('the_content', $content);

       ?>

       { src: '/wp-content/uploads/<?php echo $page->post_name ?>.jpg' },

<?php $i++;

   }    ?>
    ]);
  });

</script>

2 - image rollover - does not work in IE8

<script type="text/javascript">

$(function(){

    $("ul#artists li").hover(function() { /* On hover */

    var thumbOver = $(this).find("img").attr("src"); /* Find image source */

    /* Swap background */

    $(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') center bottom no-repeat'}); 
    $(this).find("span").stop().fadeTo('fast', 0 , function() {
        $(this).hide()
    }); 
    } , function() {
        $(this).find("span").stop().fadeTo('fast', 1).show();
    });

});

</script>

3 - artist selection - works in IE 8

<script>
    $("#browse-select").change(function() {
    window.location.href = $(this).val();
});
    </script>

, , jQuery. IE8, - , . , , , , -, , . - ?

.

, Wade

+3
1

JavaScript, PHP, , :

{foo: 1, bar: 2,}

Internet Explorer . - :

{foo: 1, bar: 2}
+6

Source: https://habr.com/ru/post/1743942/


All Articles