43 posts
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
  • Sells items exclusively on Envato Market
+1 more
Renny says

Im not that much of an expert on jQuery

im using this
$(window).scroll(function (event) {
    var y = $(this).scrollTop();
    if (y > 0) {
        $('.smenu-lower').slideUp('fast');
    } 
    else{
        $('.smenu-lower').slideDown('fast');
    }
});

to get my lower menu to slideUp on scroll down the page, and slideDown again once scrolled back to the top of the page. However i cant figure out how to get it to Slidedown when it isnt at the top when the user hovers over and then slideUp when the user hovers off

http://jsfiddle.net/YhrbW/1/ Uploaded it to here
5346 posts The Dude Abides
  • Located in United States
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+9 more
CodingJack says
http://jsfiddle.net/YhrbW/5/

var win = $(window), lower = $('.smenu-lower');

win.scroll(function() {

    slide(win.scrollTop() > 0);

});

$(".smenu").mouseenter(function() {

    slide();

}).mouseleave(function() {

    slide(true);

});

function slide(up) {

    if(up) {
        lower.slideUp('fast');
    }
    else {
        lower.slideDown('fast');
    }

}
43 posts
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
  • Sells items exclusively on Envato Market
+1 more
Renny says

Thank you for your help, however this doesnt seem to work? at all? :(

5346 posts The Dude Abides
  • Located in United States
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+9 more
CodingJack says

Thank you for your help, however this doesnt seem to work? at all? :(

I first wrote the code, then saw your fiddle and updated it :P

http://jsfiddle.net/YhrbW/5/
5346 posts The Dude Abides
  • Located in United States
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+9 more
CodingJack says

Here’s the final version as I assume you want the sticky always showing when scrollTop = 0

http://jsfiddle.net/YhrbW/6/
43 posts
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
  • Sells items exclusively on Envato Market
+1 more
Renny says

Here’s the final version as I assume you want the sticky always showing when scrollTop = 0 http://jsfiddle.net/YhrbW/6/

You really are awesome! many many thanks ! :D

Edit: found the solution changed the .smenu target to the #Sticky-Menu instead thanks again!

2nd Edit: Not sure why but it works fine on jsfiddle but in my document it doesnt work at all :S ?

43 posts
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
  • Sells items exclusively on Envato Market
+1 more
Renny says


Here’s the final version as I assume you want the sticky always showing when scrollTop = 0 http://jsfiddle.net/YhrbW/6/

You really are awesome! many many thanks ! :D

Edit: found the solution changed the .smenu target to the #Sticky-Menu instead thanks again!

2nd Edit: Not sure why but it works fine on jsfiddle but in my document it doesnt work at all :S ?

cant edit my last post, but now all fixed :)

by
by
by
by
by
by