Storm Storm - 5 months ago 9
jQuery Question

Jquery slide plugins

there are several questions like this, but none of the answers worked for me.

this happens on my site as well, when i set the direction left/right/whatever, it just shows from the up left corner no matter what i do.

i think the problem is with jquery ui... i downloaded it, i linked it, still not working. maybe it's the order of including?

can someone tell me the minimum of jquery ui i need for functions like these? (and how to get this work).

thanks a lot

fiddle

<-- here's the JSfiddle

Answer

Did you mean it to be like this?
I made a snipped for you below.
What I did was follow the jsfiddle that I provided in the comments.
By making everything apart from each other and include the needed libraries.
I dont exactly know wat went wrong with your code but I hope this helps you futher! Goodluck!

$(document).ready(function(){

	var menu = $('#menu');
	var nav = $('#nav');

	menu.click(function(){
      var effect = 'slide';
      var options = { direction: 'right' };
      var duration = 300;


    $('#nav').toggle(effect, options, duration);	
  });

});
#menu {
  width:40px;
  height:40px;
  background-color:red;
  position: fixed;
  right: 0;
  z-index:999;
}
#nav {
  width:100vw;
  height:100vh;
  background-color:yellow;
  position:absolute;
  display:none;
}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div id='menu'></div>
<div id='nav'></div>

Comments