Shaahin
Shaahin

Reputation: 1225

JQuery not working in IE, but works in Chrome and firefox

I have to develop an application which part of is IQuery but Im not familiar with it. The code must execute when mousehover on map and change background color piece of map and link color. It works in Chrome and Firefox, but no effect in Inernet Exlporer. Any help please !

Here is my code:

<script type="text/javascript" >
try{
    jQuery(document).ready(function () {

        $.fn.maphilight.defaults = {
            fill: true,
            fillColor: '008000',
            fillOpacity: 0.8,
            stroke: false,
            strokeColor: 'ff0000',
            strokeOpacity: 1,
            strokeWidth: 1,
            fade: true,
            alwaysOn: false,
            neverOn: false,
            groupBy: false
        };
        $(".main-menu").mouseover(function () {
            alert('go');
            var himg = $(this).attr('himg')
            $(this).children().attr('src', himg)
        });

        $(".main-menu").mouseout(function () {
            var nimg = $(this).attr('nimg')
            $(this).children().attr('src', nimg)
        });

        $("a.fancybox").fancybox({
            'titlePosition': 'inside'
        });

        $("a.iframe").click(function () {
            $.fancybox({
                'padding': 0,
                'margin': 0,
                'autoScale': false,
                'transitionIn': 'none',
                'transitionOut': 'none',
                'width': 980,
                'height': 575,
                'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
                'type': 'iframe'
            })
            return false;
        });

        $('#photos').galleryView({
            panel_width: 900,
            panel_height: 300,
            frame_width: 160,
            frame_height: 110
        }); 
        $("#one").sexyCombo({
            emptyText: "Select"
        });
        $("#two").sexyCombo({
            emptyText: "Select"
        });
        $("#three").sexyCombo({
            emptyText: "Select"
        });

    }); 
    }
catch (err)
 {
    alert(err);
 }
</script>

Upvotes: 0

Views: 308

Answers (1)

rgin
rgin

Reputation: 2311

Remove the try-catch call. You don't seem to really need that there and is causing the offense in IE.

Upvotes: 1

Related Questions