Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Need help with script editor

$
0
0

I have this code to create a mega menu.

I added it in a script editor on a site but it looks like the .css is not working. Can someone advise? I got my examples from:

http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/getting-started/http://blog-aspc.azurewebsites.net/so-whats-on-the-megamenu/



This is my code:

********code*******

<link href="https://bla/nav/script/css/dcmegamenu.css" rel="stylesheet" type="text/css" />
<link href="https://bla/nav/script/css/skins/black.css" rel="stylesheet" type="text/css" />

<script src="https://bla/nav/script/jquery-1.11.1.min.js"></script>

<script src="https://bla/nav/script/js/jquery.hoverIntent.minified.js"></script>
<script src="https://bla/nav/script/js/jquery.dcmegamenu.1.3.3.js"></script>


<script>
$(document).ready(function() {
var topmenuClass = '.ms-core-listMenu-horizontalBox';
        $(topmenuClass + ' .ms-hidden').html('');
        $(topmenuClass + ' ul li a span').not('[class="ms-navedit-editLinksIconWrapper"]').replaceWith(function () {
            return $(this).html();
        });
 
        $(topmenuClass + ' ul li a span').not('[class="ms-navedit-editLinksIconWrapper"]').replaceWith(function () {
            return $(this).html();
        });
 
        $(topmenuClass + ' ul li a span').not('[class="ms-navedit-editLinksIconWrapper"]').replaceWith(function () {
            return $(this).html();
        });
 
        $(topmenuClass + ' a').each(function () {
            var title = $(this).html();
            var strs = title.split("#");
            if (strs.length > 1) {
                $(this).html(strs[0]);
                $(this).parent().attr('id', strs[1]);
                PopulateFromList($(this).parent());
            }
        });
 
        $(topmenuClass + ' .ms-core-listMenu-root').attr('id', 'mega-menu-tut');
        $(topmenuClass + ' ul').removeClass();
        $(topmenuClass + ' li').removeClass();
        $(topmenuClass + ' a').removeClass();
        $('#mega-menu-tut').removeClass().addClass('menu');
        $(topmenuClass).removeClass();
 
        $('#mega-menu-tut').wrap('<div id="kiosk-searcharea" class="dcjq-mega-menu" />');
 
        $('#mega-menu-tut').dcMegaMenu({
            rowItems: '2',
            speed: 'fast',
            effect: 'fade',
            fullWidth: false
        });
});
</script>

******* end code ******

I try to achieve this in Office365 /Sharepoint online.

Thanks






Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>