This is a migrated thread and some comments may be shown as answers.

Force position off Screen

2 Answers 86 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 02 Sep 2011, 04:41 PM
Hi there,

I have a list of item and each item is clickable to popup a tooltip.  I'm looking to position the tooltip popup relative to the element, positioned bottom center.  However, when clicking on an item near the bottom of the screen, the tooltip popup recalculates the position so that it doesn't get displayed off the screen.  I am wondering, is it possible to force the popup to go off the screen to maintain the bottom center popup position.

John

2 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 07 Sep 2011, 03:43 PM
Hello John,

What you want to achieve is not available out of the box because the more intuitive behavior for a tooltip in most of the scenarios is to be "intelligent enough" to detect browser boundaries and to reposition itself. However, you could override this behavior by putting the following script I prepared for you on your page:

<script type="text/javascript">
    var $T = Telerik.Web.UI;
 
    $T.RadToolTip.prototype._oldCreateUI = $T.RadToolTip.prototype._createUI;
    $T.RadToolTip.prototype._createUI = function () {
        this._oldCreateUI();
        if (this._popupBehavior) this._popupBehavior.set_keepInScreenBounds(false);
    };
 
</script>


For your convenience I prepared and attached a sample page - resize the browser to a smaller size and show the tooltip - it will not reposition. Please, test my suggestion and let me know how it goes.

All the best,
Svetlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
John
Top achievements
Rank 1
answered on 07 Sep 2011, 04:08 PM
Perfect, exactly what I'm looking for.  Thanks!!
Tags
ToolTip
Asked by
John
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
John
Top achievements
Rank 1
Share this question
or