Jquery works in JSFiddle, but not SharePoint?

http://jsfiddle.net/Palumbob/e5x7txa7/

This works fine here, but when I bring it over to SharePoint the buttons that switch it from cube to list view does not work. My alert comes up but the class change isn't affected.

Any ideas?

May 15th, 2015 12:47pm

Hi

have you checked the jQuery references, if jQuery is getting loaded. You can check this using developer tools under script tab, if there is any error ot will be shown there.

Also which browser you are using, have you checked in different browser.

Free Windows Admin Tool Kit Click here and download it now
May 17th, 2015 10:52am

Hi,

Please add the following jQuery script code into a Content Editor Web Part.

<script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $(".show-list").click(function () {
            $(".wrapper").addClass("list-mode");
        });
        $(".hide-list").click(function () {
            $(".wrapper").removeClass("list-mode");
        });
    });
</script>

Best Regards,

Dennis

May 17th, 2015 10:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics