I have a list of items, and each one has a Bootstrap popover associated with it (docs here). They are initiated like this:
$('#my_list li').popover({
placement: 'left'
});
This works, but at small widths the popover is lost from the viewport. I'd like to make the placement conditional based on $(document).width();
, however I can't see a way to over-ride the initial options (e.g. at at width of around 1000px, switch the placement to 'above').
I've put together a simplified version at jsfiddle here. Many thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…