Code Monkey home page Code Monkey logo

sliiide's Introduction

Checkout the demo here.

First things first, this plugin is currently in Beta, please feel free to take if for a test ride into the wild and send back any feedback or bugs you might encounter. I created this plugin out of frustration with all the slider jQuery plugins out there that just weren’t doing it for me. Enjoy :)

##What to use this for? You have a div (probably a nav menu or a side bar) that you want to animate with a sliding effect from outside the viewport to inside the viewport. You want to have complete control over the distance this div slides but you don’t want to worry about how to position it or how to stretch it to match the screen’s dimensions. You also don’t wanna bother with how the animation affects the rest of the page, how to deal with scrolling and the logic behind activating and deactivating the menu.

##Any Dependencies? The plugin is built on jQuery 2.1.0 but could potentially work with older and newer versions, give it a shot and let me know how it goes if you run into any problems. Otherwise, there’s no CSS file or anything else needed. This plugin manipulates inline styles for the element you're using as a slide menu and some manipulation to the body element. If you're also doing a lot of inline style manipulation you might run into conflicts.

####this plugin officially supports chrome, firefox, safari, IE 10/11 and Edge

##How to use it? 1- Download the sliiide js file (or the minified version) from the github repo, include the js file before the body end tag and make sure jQuery is included before it. Or just use bower "bower install sliiide"

2- you’ll need a div (a nav menu or whatever you have in mind) and set its visibility to hidden. PLEASE MAKE SURE THIS DIV IS A DIRECT CHILD OF THE BODY ELEMENT. You also need a settings object.

	var settings = {
      		toggle: "#sliiider-toggle", // the selector for the menu toggle, whatever clickable element you want to activate or deactivate the menu. A click listener will be added to this element.
      		exit_selector: ".slider-exit", // the selector for an exit button in the div if needed, when the exit element is clicked the menu will deactivate, suitable for an exit element inside the nav menu or the side bar
      		animation_duration: "0.5s", //how long it takes to slide the menu
     		place: "left", //where is the menu sliding from, possible options are (left | right | top | bottom)
      		animation_curve: "cubic-bezier(0.54, 0.01, 0.57, 1.03)", //animation curve for the sliding animation
      		body_slide: true, //set it to true if you want to use the effect where the entire page slides and not just the div
     		no_scroll: true, //set to true if you want the scrolling disabled while the menu is active
				auto_close: false //set to true if you want the slider to auto close everytime a child link of it is clicked
    			};

	$(‘#menu’).sliiide(settings); //initialize sliiide

3- If you’re going to slide that div horizontally (from the right or left) then you need to style the width of the div yourself and sliiide will stretch the height for you to full window height. If you’re going to slide it vertically (from the top or the bottom) then you need to style the height and sliiide will stretch the width for you. the sliding effect will change to match whatever styling you added to the width (or height) of the element.

4- useful functions available for you:

  var menu = $('.left-menu').sliiide({place: 'left', exit_selector: '.some-exit-selector', toggle: '#some-toggle-selector,        no_scroll: true, body_slide: true'});

  menu.activate(); //slides the menu open
  menu.deactivate(); //slides the menu closed
  menu.reset(); //removes all the css that sliiide added to any element

That’s it, you now should be good to go, feel free to report back any issues you encounter I’m happy to continue working on this.

sliiide's People

Contributors

ahmedrad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sliiide's Issues

package.json

It would be nice to include a pacake.json file so that the repository can be downloaded with npm install.

Toggle image by click or swipe

Hi,

I create a panel menu with Sliiide. I want to toggle the menu image when opening and closing the menu, by click or when swiping. How can I do this? Click is working, but not when swiping.
Example: lauralisa.nl/ralf (user rm/pass 643).

TIA!
Regards, Laura

Close the menu

Hello,

I offer a small option,
If you click (close menu) close the menu?

Menu scroll

HI, Im trying the script but for example I got a large menu that is around 500pixels height. While this is fine on portait , on landscape the phone height is 375 so I need to scroll the menu in order to see all items but currently is not posible.

Thanks

close navigation

need to close navigation when clicked anywhere out side navigation

no_scroll: true not working on mobile

I noticed that the no_scroll: true parameter isn't working on mobile devices.

Also, you may want to add overflow: auto to the slideout menu area to enable scrolling if the menu items reach below the initial viewport.

On Chrome, when you scroll down (as it allows you to scroll), the URL area disappears and leaves a gap below the slideout menu the same height as the URL area was. This will probably be fixed when the no_scroll thing is fixed.

Let me know if you need more info - great script! :)

preventDefault passive

When no_scroll set to true if I want the scrolling disabled while the menu is active in settings, google chrome browser give that error when menu is active and every scrolling:
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/feature/6662647093133312
preventDefault @ sliiide.debug.js:369

Html Overflow-X: Hidden Issue

Noticed when toggling a class that there is a flicker for overflow-x: hidden on the HTML tag. I added overflow-x hidden as an attribute to my stylesheet to correct the issue. Not sure if this is the way to go but thought I'd report the issue.

Also, if I remove the toggle class jquery on click function that I created, the horizontal scroll bar flicker no longer appears.

Hope this helps.

Caching

I use sliiide. My site is rather large, with 450+ links in the sliiide pane. As a result, there's a white flash every time I load a page on the site because the sliiide panel is loaded.
Does anyone have any ideas to:

  • Cache the pane and read it from a file or memory
  • Defer the loading of the sliiide pane until everything else has loaded
  • Or something else?

That would be really helpful. Doesn't somebody else have this problem?

License info

Hi! I am a member of CDNJS!
We would like to add this library to our CDN, and we need to check if its license is MIT. Thanks!
issue ref

Create events (OnSlide, OnSlideFinished)

It would be very helpful to work with events. Such as OnSlide which indicates if the animation is still ongoing or OnSlideFinished which should also pass the information if the side panel is now visible or not.

This would allow us to hide/show/modify the toggle button for example.

Stay open

Hi,
Is there any way to make the menu stay open after clicking a link?
-Niels

IE Compatibility?

I see quite a few issues when viewing in IE11 on my machine. The slid elements do not have their visibility unhidden and are not in the correct position. Also, on your demo site content from the bottom slide is appearing on the main page before clicking anything (the tweet button), the main text not vertically centered, and the menu hamburger is distorted.

In Chrome I found that if the content of the page is > the view height the bottom slider does not slide up all the way.

I tested this on a single page with a sliiide from each direction (similar to the demo) with horizontal slides 100vw, and vertical slides 100vh.

Slick library. Thank you for sharing it.

Scroll inside menu

Hi, I'm wondering if there is a way to scroll through a long list inside the Sliiide menu? I tried using overflow-y: scroll but no luck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.