0

While I have seen issues with the Bootstrap Collapse functionality in IE, this one I think is different.

The thing collapses when you first click on the "Exclusively for you!" header, but clicking again won't open it.

I have to "store" the fact that they closed it in a session variable so I have a function in my controller to do that and it is called when the header is clicked. I collapse again when the page is loaded if the ShowPanel is set to "false".

The window.ShowPanel variable is set from a Razor ViewBag variable:

<script type="text/javascript">
    $(document).ready(function () {
        window.ShowPanel = "@ViewBag.ShowPanel";
        // Initialize due to IE bug. from some SO post
        $('#collapseOne').collapse({ toggle: false });

        if (window.ShowPanel === "false") {
            $('#collapseOne').collapse('hide');
        }

        $('#panel_head').on('click', function () {
            $.ajax({
                async: true,
                type: "GET",
                url: "/Home/SetShowPanel"
            });
        })
    });
</script>

Can anyone help me figure out why IE won't re-open the section?

Fiddle: http://jsfiddle.net/Mrbaseball34/wwvogjkk/

MB34
  • 4,210
  • 12
  • 59
  • 110
  • I am getting "access is denied" error in IE console. Maybe it got something to do with this question? http://stackoverflow.com/questions/17370482/preventing-script5-access-is-denied-error-in-ie – hapass Jan 29 '15 at 23:32
  • you know what, this error got something to do with my antivirus (avast) plugin, so nevermind – hapass Jan 29 '15 at 23:35
  • At least upgrade to Bootstrap v2.3.2, the final v2 release. – cvrebert Jan 30 '15 at 06:00

1 Answers1

0

Did you mess with bootstrap.css? I updated bootstrap to version 2.3.2 and it works in IE. The collapse works in IE, but the styles are gone.

http://jsfiddle.net/wwvogjkk/21/

$(document).ready(function () {
    window.ShowPanel = "true";
    // Initialize due to IE bug.
    $('#collapseOne').collapse({ toggle: false });

    if (window.ShowPanel === "false") {
        $('#collapseOne').collapse('hide');
    }

    $('#panel_head').on('click', function () {
        debugger;
        $.ajax({
            async: true,
            type: "GET",
            url: "/Home/SetShowPanel"
        });
    })
});

P.S. I didn't touch the code, it is here so that the SO would let me give you a link to latest version of the fiddle with new bootstrap referenced.

hapass
  • 322
  • 6
  • 16
  • Yes the designer didn't know better to just create a separate file for his changes. We'd like to upgrade but with the number of changes, it's going to be a manual process because this is not the typical 2.0.4 css file. I think I may have the original in source control, though. – MB34 Jan 30 '15 at 17:47