Giter VIP home page Giter VIP logo

directionawarehovereffect's Introduction

DirectionAwareHoverEffect

How to create a direction-aware hover effect using CSS3 and jQuery. The idea is to slide in an overlay from the direction we are moving with the mouse.

article on Codrops

demo

How to use

$('#da-thumbs > li').hoverdir();
// or with options
$('#da-thumbs > li').hoverdir({hoverDelay: 75, hoverElem: '.elem'});

Default options

defaults: {
    speed: 300, // Times in ms
    easing: 'ease',
    hoverDelay: 0, // Times in ms
    inverse: false,
    hoverElem: 'div'
}

Method

show

Show the hover element, after show method is triggered, hover don't show or hide on mouseenter and mouseleave. You have to use hide method to bind mouseenter and mouseleave.

$('#da-thumbs > li').hoverdir('show'); // Default value top
// or with a specific direction
$('#da-thumbs > li').hoverdir('show','bottom'); // Possible value top, right, bottom, left

hide

Hide the hover element and bind mouseenter and mouseleave.

$('#da-thumbs > li').hoverdir('hide'); // Default value bottom
// or with a specific direction
$('#da-thumbs > li').hoverdir('hide','top'); // Possible value top, right, bottom, left

setOptions

Allows you to change the options while the plugin is already running

$('#da-thumbs > li').hoverdir('setOptions', options);

destroy

Unbind the plugin

$('#da-thumbs > li').hoverdir('destroy');

rebuild

Bind the plugin

$('#da-thumbs > li').hoverdir('rebuild');
// or with options
$('#da-thumbs > li').hoverdir('rebuild', options);

Licensed under the MIT License

directionawarehovereffect's People

Contributors

afercia avatar botelho avatar bryant1410 avatar daniel-hopkins avatar nickmelville 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  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

directionawarehovereffect's Issues

[enhancement] Add missing bower.json.

Hey, maintainer(s) of codrops/DirectionAwareHoverEffect!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library codrops/DirectionAwareHoverEffect is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "codrops/DirectionAwareHoverEffect",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

IE 11 version

Hi! Great hover effect!
Can you help on how can I make this work on IE 11?
Its working with Chrome, but where I want to use it people still have IE 11 only.
Thanks!

Page loads with divs displayed over images...

I'm sure there's something simple that I've done in setting up the Direction Aware Hover Effect for a test site. When the page first loads, the overlay divs appear over the images until I mouse over them, then they disappear as I mouse over each image. From that point everything works as expected. Has anybody else seen this? How do I fix it? Does it have something to do with the container div that the unordered list is placed in?

Thanks for any insights!

npm release

It would be great if this library would be available via npm.
This would simplify the inclusion in our projects by far.

Missing tag

Could you fix a version using a tag please ?

Keep up the good work !

Tips for using DirectionAwareHoverEffect on mobile devices

Hi
I'm just wondering if you have any tips for using this effect so it works as a first tap on mobile devices. I've added a mail to link when clicked with a mouse (works fine on desktops and fires the mailto after the hover effect) but would like the mailto link to fire on second tap on a mobile device.
I'm using jquery.hoverdir.js v1.1.2
thx in advance great hover effect BTW

CKEDITOR changes HTML tags

Hi

It is very Good. I've added This code in CMS that use CKEDITOR, so CKEDITOR have some process in HTML and change your code. and this changes is reason of not working this beautiful effect.

For your demo it became lik code below:(I am so sorry for this bad face post, but it is important for me,)

<section><ul class="da-thumbs" id="da-thumbs"> <li><a href="http://dribbble.com/shots/505046-Menu"><img src="images/1.jpg" /> </a> <div style="display: block; left: 0px; top: 100%; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/505046-Menu"><span>Menu by Simon Jensen</span></a></div> <a href="http://dribbble.com/shots/505046-Menu"> </a></li> <li><a href="http://dribbble.com/shots/504336-TN-Aquarium"><img src="images/2.jpg" /> </a> <div style="display: block; left: 0px; top: 100%; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/504336-TN-Aquarium"><span>TN Aquarium by Charlie Gann</span></a></div> <a href="http://dribbble.com/shots/504336-TN-Aquarium"> </a></li> <li><a href="http://dribbble.com/shots/504197-Mr-Crabs"><img src="images/3.jpg" /> </a> <div style="display: block; left: 100%; top: 0px; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/504197-Mr-Crabs"><span>Mr. Crabs by John Generalov</span></a></div> <a href="http://dribbble.com/shots/504197-Mr-Crabs"> </a></li> <li><a href="http://dribbble.com/shots/503731-Gallery-of-Mo-2-Mo-logo"><img src="images/4.jpg" /> </a> <div style="display: block; left: 0px; top: -100%; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/503731-Gallery-of-Mo-2-Mo-logo"><span>Gallery of Mo 2.Mo logo by Adam Campion</span></a></div> <a href="http://dribbble.com/shots/503731-Gallery-of-Mo-2-Mo-logo"> </a></li> <li><a href="http://dribbble.com/shots/503058-Ice-Cream-nom-nom"><img src="images/5.jpg" /> </a> <div style="display: block; left: 100%; top: 0px; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/503058-Ice-Cream-nom-nom"><span>Ice Cream - nom nom by Eight Hour Day</span></a></div> <a href="http://dribbble.com/shots/503058-Ice-Cream-nom-nom"> </a></li> <li><a href="http://dribbble.com/shots/502927-My-Muse"><img src="images/6.jpg" /> </a> <div style="display: block; left: 100%; top: 0px; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/502927-My-Muse"><span>My Muse by Zachary Horst</span></a></div> <a href="http://dribbble.com/shots/502927-My-Muse"> </a></li> <li><a href="http://dribbble.com/shots/502538-Natalie-Justin-Cleaning"><img src="images/7.jpg" /> </a> <div style="display: block; left: 0px; top: -100%; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/502538-Natalie-Justin-Cleaning"><span>Natalie &amp; Justin Cleaning by Justin Younger</span></a></div> <a href="http://dribbble.com/shots/502538-Natalie-Justin-Cleaning"> </a></li> <li><a href="http://dribbble.com/shots/502523-App-Preview"><img src="images/8.jpg" /> </a> <div style="display: block; left: 100%; top: 0px; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/502523-App-Preview"><span>App Preview by Ryan Deshler</span></a></div> <a href="http://dribbble.com/shots/502523-App-Preview"> </a></li> <li><a href="http://dribbble.com/shots/501695-Cornwall-Map"><img src="images/9.jpg" /> </a> <div style="display: block; left: 0px; top: 100%; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/501695-Cornwall-Map"><span>Cornwall Map by Katharina Maria Zimmermann</span></a></div> <a href="http://dribbble.com/shots/501695-Cornwall-Map"> </a></li> <li><a href="http://dribbble.com/shots/500861-final-AD-logo"><img src="images/10.jpg" /> </a> <div><a href="http://dribbble.com/shots/500861-final-AD-logo"><span>final AD logo by Annette Diana</span></a></div> <a href="http://dribbble.com/shots/500861-final-AD-logo"> </a></li> <li><a href="http://dribbble.com/shots/500369-Land-Those-Planes"><img src="images/11.jpg" /> </a> <div style="display: block; left: 100%; top: 0px; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/500369-Land-Those-Planes"><span>Land Those Planes by Lee Ann Marcel</span></a></div> <a href="http://dribbble.com/shots/500369-Land-Those-Planes"> </a></li> <li><a href="http://dribbble.com/shots/497795-Seahorse"><img src="images/12.jpg" /> </a> <div style="display: block; left: 0px; top: -100%; transition: all 300ms ease 0s;"><a href="http://dribbble.com/shots/497795-Seahorse"><span>Seahorse by Trevor Basset</span></a></div> <a href="http://dribbble.com/shots/497795-Seahorse"> </a></li></ul></section>

If you pay attention you will see id we change UL/LI to DIV maybe problem solve.

thanks

error when attempting to destroy

when attempting to call$('.miHolder').each(function(){$(this).hoverdir('destroy'); } ); gives an error "cannot call methods on hoverdir prior to initialization; attempted to call method 'destroy'"

The reason for the .each is the hoverdiv() only gets applied to the first .miHolder, even when using $("#miTHumbs &gt; li").hoverdiv(). So my initialization line is: $('.miHolder').each(function(){$(this).hoverdir(); } ); And this line is call long before I try to run the destroy. and even if I run the line in an inspector console I still get the error. Even If I use a non .each() initialization I still get the same error when trying a 'destroy'

why is this error occurring, what would prevent the elements from being recognized as initialized?

Thank you,
-N8

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.