Tomer
Tomer

Reputation: 17930

JQM popup not showing correctly

I'm using JQM 1.3.1. I have a page that displays a list of items and next to each item there is a button that when clicked, shows a popup with some general info:

enter image description here

IMPORTANT : I need the popup to appear next to the pressed button

The problem is that when the object is on the bottom of the page, the popup appears cut and there is no way to scroll down:

enter image description here

here is the code that displays the popup:

$('.capbPlanDetailsPopup').popup('open', {
                positionTo: 'origin',
                x: btn.offset().left + btn.outerWidth() + 15,
                y: btn.offset().top - 35
            }); // pos is width/2 + width of menu image

Upvotes: 0

Views: 91

Answers (1)

Tomer
Tomer

Reputation: 17930

Found a possible solution, JQM provides a tolerance option, which enables you to set how closes to the window edge you allow the popup to appear:

//the popup height is 240px
$('.capbPlanDetailsPopup').popup({tolerance: "0,0,240,0" });

Although not the best solution since at the bottom the popup will not appear right next to the button, but it will do for now

Upvotes: 1

Related Questions