jquery-cluetip icon indicating copy to clipboard operation
jquery-cluetip copied to clipboard

Dynamic Width

Open gbfromhb opened this issue 12 years ago • 2 comments

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?

gbfromhb avatar Oct 10 '12 21:10 gbfromhb

Would be great...

pedromagalhaes avatar Mar 22 '13 15:03 pedromagalhaes

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.

  1. Set the cuetip width to close to or the widest you want it to be (the not perfect part).
  2. 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 }); } }

gbfromhb avatar Nov 06 '13 18:11 gbfromhb