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
5390 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? :(

5390 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/
5390 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 :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by