Skip to content

Conversation

@andersonk17474
Copy link

added a slightly modified version of the nudge function from Nicolas Honing's popup.js (https://github.com/nhoening/popup.js/) that will prevent messi from appearing off the page when using manual positioning

ex:

(pseudo html)
( span class="test" style="position:absolute; top:400px; left: 1000px;" >test /span )
(/html)

<script type="text/javascript"> $( document ).ready(function(){ ``` console.log("loaded"); var popup; $('.test').on('mouseover', function(e){ popup = new Messi('This is a message with Messi.', {closeButton : false, center: false, viewport : { top: ( e.pageY.toString()+"px"), left: ( e.pageX.toString()+"px")} }); }); $('.test').on('mouseout', function(e){ if (typeof popup === "object" ){ popup.hide(); } }); ``` });

added a slightly modified version of the nudge function  from Nicolas Honing's popup.js (https://github.com/nhoening/popup.js/) that will prevent messi from appearing off the page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant