Skip to content

Improvement Request: Smarter Placement When Every Placement Yields a Collision #99

@speedplane

Description

@speedplane

Hi again,

As I mentioned in an earlier issue, some of my pages use very large tooltips (hover over Google and Oracle to see them). The smartPlacement feature is great, but it fails to work very well when every placement yields at least one collision. In the link above, when you hover over Google, no matter where you place the tooltip there will be at least one collision.

However, even where there must be a collision, some placements are more preferable to others. For example, if there must be a collision, then one would prefer the tooltip to be placed in such a way that the user could scroll the screen to see the entire tooltip. That way, even though the tooltip collides with the viewport, it does not collide with the browser window.

I put together a solution, by adding a new collision type that gets set when the tooltip falls outside of the browser window (as opposed to falling outside the viewport). When we're looking for the best placement, it selects the placement with either no viewport collisions, or if none exists the placement with no browser collisions.

My solution is located here

Activity

speedplane

speedplane commented on Aug 5, 2013

@speedplane
Author

Here is a screenshot with the problem:

image

And here it is after applying my fix:

image

stevenbenner

stevenbenner commented on Aug 5, 2013

@stevenbenner
Owner

This might be a duplicate of issue #30. I've saved a copy of your modified version, I'll take a look at how your code works when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureSoftware improvements that involve implementing new features.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @stevenbenner@speedplane

        Issue actions

          Improvement Request: Smarter Placement When Every Placement Yields a Collision · Issue #99 · stevenbenner/jquery-powertip