Menu icon Foundation

My Posts



My Comments

Rhys Edwards commented on Rhys Edwards's post about 3 years

Wow, appreciate your help, its working! 
I used that jQuery cdn and put "$(document).foundation();" underneath my $(document).ready(function() { and its now working.
If you feel like being extra helpful i am now getting this error in the console:
"foundation.min.js:1 Tried to initialize sticky on an element that already has a Foundation plugin."

Rhys Edwards commented on Rhys Edwards's post about 3 years

I also tried commenting everything else out and it still doesn't work.

Rhys Edwards commented on Rhys Edwards's post about 3 years

I put $(document).foundation(); at the bottom of my jQuery underneath everything and i get this error in the console: 
Uncaught TypeError: $(...).foundation is not a function

Rhys Edwards commented on Rhys Edwards's post about 3 years

Ok and where do i put that in my js? I tried putting it at the top and i get an console error. 
"Uncaught TypeError: $(...).foundation is not a function"
 
$(document).foundation();
$(document).ready(function() {
$(".arrowDown, .page2").click(function() {
$('html, body').animate({
scrollTop: $(".div2_wrapper").offset().top
}, 1000);
});

$(".page3").click(function() {
    $('html, body').animate({
        scrollTop: $(".div3_wrapper").offset().top
    }, 1000);
});

$(".page1").click(function() {
    $('html, body').animate({
        scrollTop: $(".div1_wrapper").offset().top
    }, 1000);
});

$(".page4").click(function() {
    $('html, body').animate({
        scrollTop: $(".div4_wrapper").offset().top
    }, 1000);
});

$(window).on("scroll", function() {
    if ($(window).scrollTop() < 1000) {
        $("#social_side_links").fadeOut(500);
    } else {
        $("#social_side_links").fadeIn(500);
    }
});

$(window).scroll(function() {
    var wScroll = $(this).scrollTop();

    if (wScroll > $("#div4_wrapper").offset().top - 60) {
        $(".topRibbon").slideDown(300);
        $(".topRibbonMail").slideDown(300);
    } else {
        $(".topRibbon").slideUp(1);
        $(".topRibbonMail").slideUp(1);
    }
    if (wScroll > $("#div1_wrapper").offset().top + 300) {
        $(".arrowDiv").fadeOut(700);
    } else {
        $(".arrowDiv").fadeIn(700);
    }
});

});

Rhys Edwards commented on Rhys Edwards's post about 3 years

Hi thanks for the reply Will,
I just commented out my foundation js cdn and my nav still works btw so i don't think its picking up the js cdn at all. 
I have 4 divs with a height of 800px each so i definitely have content. I just don't understand why it's not working 
Also i noticed in the codepen you made for me, you have this in the js
"$(document).foundation();" 
Do i need that or is that just for codepen? 

Posts Followed


Following

    No Content

Followers

My Posts


My Comments

You commented on Rhys Edwards's post about 3 years

Wow, appreciate your help, its working! 
I used that jQuery cdn and put "$(document).foundation();" underneath my $(document).ready(function() { and its now working.
If you feel like being extra helpful i am now getting this error in the console:
"foundation.min.js:1 Tried to initialize sticky on an element that already has a Foundation plugin."

You commented on Rhys Edwards's post about 3 years

I also tried commenting everything else out and it still doesn't work.

You commented on Rhys Edwards's post about 3 years

I put $(document).foundation(); at the bottom of my jQuery underneath everything and i get this error in the console: 
Uncaught TypeError: $(...).foundation is not a function

You commented on Rhys Edwards's post about 3 years

Ok and where do i put that in my js? I tried putting it at the top and i get an console error. 
"Uncaught TypeError: $(...).foundation is not a function"
 
$(document).foundation();
$(document).ready(function() {
$(".arrowDown, .page2").click(function() {
$('html, body').animate({
scrollTop: $(".div2_wrapper").offset().top
}, 1000);
});

$(".page3").click(function() {
    $('html, body').animate({
        scrollTop: $(".div3_wrapper").offset().top
    }, 1000);
});

$(".page1").click(function() {
    $('html, body').animate({
        scrollTop: $(".div1_wrapper").offset().top
    }, 1000);
});

$(".page4").click(function() {
    $('html, body').animate({
        scrollTop: $(".div4_wrapper").offset().top
    }, 1000);
});

$(window).on("scroll", function() {
    if ($(window).scrollTop() < 1000) {
        $("#social_side_links").fadeOut(500);
    } else {
        $("#social_side_links").fadeIn(500);
    }
});

$(window).scroll(function() {
    var wScroll = $(this).scrollTop();

    if (wScroll > $("#div4_wrapper").offset().top - 60) {
        $(".topRibbon").slideDown(300);
        $(".topRibbonMail").slideDown(300);
    } else {
        $(".topRibbon").slideUp(1);
        $(".topRibbonMail").slideUp(1);
    }
    if (wScroll > $("#div1_wrapper").offset().top + 300) {
        $(".arrowDiv").fadeOut(700);
    } else {
        $(".arrowDiv").fadeIn(700);
    }
});

});

You commented on Rhys Edwards's post about 3 years

Hi thanks for the reply Will,
I just commented out my foundation js cdn and my nav still works btw so i don't think its picking up the js cdn at all. 
I have 4 divs with a height of 800px each so i definitely have content. I just don't understand why it's not working 
Also i noticed in the codepen you made for me, you have this in the js
"$(document).foundation();" 
Do i need that or is that just for codepen? 

Posts Followed

Following

  • No Content

Followers

  • No Content