Difference between revisions of "Template:AUC TURKEY"

Line 56: Line 56:
 
<script>
 
<script>
 
     // Calling the function  
 
     // Calling the function  
$(function(){
+
$(function() {
        // get the top offset of the menu element var  
+
    // get the top offset of the menu element var  
        menuTop = $("#menu").offset().top;
+
    menuTop = $("#menu").offset().top;
        // trigger the function when the windows scroll  
+
    // trigger the function when the windows scroll  
        $(window).scroll(function() {
+
    $(window).scroll(function() {
            // get total scrolling  
+
        // get total scrolling  
            var htmlTop = $(window).scrollTop();
+
        var htmlTop = $(window).scrollTop();
            // check if the scrolling is less than top offset of menu
+
        // check if the scrolling is less than top offset of menu
            // then stick the menu on top by adding the stickyCssClass  
+
        // then stick the menu on top by adding the stickyCssClass  
            // If not then set the menu at it's default position by removing the stickyCssClass
+
        // If not then set the menu at it's default position by removing the stickyCssClass
            if (htmlTop > menuTop) {
+
        if (htmlTop > menuTop) {
                // add the class to stick on top  
+
            // add the class to stick on top  
                $("#menu").addClass(".fixedMenu");
+
            $("#menu").addClass(".fixedMenu");
                $("#contentContainer").addClass(".shiftContent");
+
            $("#contentContainer").addClass(".shiftContent");
            } else {
+
        } else {
                // remove the stick on top class  
+
            // remove the stick on top class  
                $("#menu").removeClass(".fixedMenu");
+
            $("#menu").removeClass(".fixedMenu");
                $("#contentContainer").removeClass(".shiftContent");
+
            $("#contentContainer").removeClass(".shiftContent");
            }
+
        }
        }});
+
    });
 +
});
 
</script>
 
</script>
 
<div class="menu">
 
<div class="menu">

Revision as of 11:44, 23 June 2015