Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Slidepanel with Jquery Doubt

Featured Replies

hi there guys. I was making some test's here with jquery, wanting to make a slideup panel on mouseenter and mouseleave. It's the first time I'm working with javascript, so I don't know nothing about it. The panel is already sliding down (and i wanted ti slide up) at rollover. but I don't know how to do rollout. can someone help me to do a rollover and rollout and to make the panel slide to the right direction, please?

 

<!DOCTYPE HTML>
<html>
<head>
<title></title>
   <style type="text/css">


       #div_01 {
   height: 215px;
   width: 200px;
            }

       #div_01 a {
   height: 215px;
   width: 200px;
   background-color: #900;
   display: block;
           }


       #div_02 {
   height: 185px;
   width: 170px;
   background-color: #3F0;
   padding: 15px;
   display: none;
           }


   </style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
   <script type="text/javascript">

jQuery(function( $ ){

var div_02 = $( "#div_02" );


$( "a" ).mouseover(
function( event ){

event.preventDefault();

if (div_02.is( ":visible" )){

div_02.slideUp( 500 );
} else {
div_02.slideDown( 500 );

}
}
);
});        
</script>

</head>
<body>

<div id="div_01">
<a href="#"></a>
<div id="div_02">
</div>
</div>



</body>
</html>

thanks in advance

Not sure if I've understood correctly, but to hide the panel again;

 

Replace:

<script type="text/javascript">

jQuery(function( $ ){

var div_02 = $( "#div_02" );


$( "a" ).mouseover(
function( event ){

event.preventDefault();

if (div_02.is( ":visible" )){

div_02.slideUp( 500 );
} else {
div_02.slideDown( 500 );

}
}
);
});        
</script>

 

With this:

<script type="text/javascript">

jQuery(function( $ ){

var div_02 = $( "#div_02" );


$( "a" ).mouseover(
   function( event ){

       event.preventDefault();

       if (div_02.is( ":visible" )){
           div_02.slideUp( 500 );
       }
       else {
           div_02.slideDown( 500 );
       }
   }
);

$( "a" ).mouseout(
   function( event ){

       event.preventDefault();

       if (div_02.is( ":visible" )){
           div_02.slideUp( 500 );
       }
       else {
           div_02.slideDown( 500 );
       }
   }
);

});        
</script>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.