jquery-cluetip
jquery-cluetip copied to clipboard
Dynamic Width
I'm using Ajax to get dynamic content. Is there a way that the width can be set to fit the content or a max width?
Would be great...
I have come up with a workaround. I's not pretty and not perfect. It will put the popup on the left more often the it should, but here it is.
- Set the cuetip width to close to or the widest you want it to be (the not perfect part).
- Add the following to the cluetip onShow event: onShow: function(ct, ci) { var startingWidth = $(".ui-cluetip").width(); $(".ui-cluetip").css({ width: 'auto' }); if($(this).position().left > $(".ui-cluetip").position().left) { var newLeft = $(".ui-cluetip").position().left + (newLeft = startingWidth - $(".ui-cluetip").width()); $(".ui-cluetip").css({ left: newLeft }); } }