sweet-dropdown icon indicating copy to clipboard operation
sweet-dropdown copied to clipboard

data-add-x data-add-anchor-x how to use

Open YvonneD opened this issue 7 years ago • 3 comments

I'm a newbie and wonder how to use the attribute data-add-x and data-add-anchor-x. Anyone can give me an example? Thanks. And if anyone can explain how to apply all the methods in the document.

YvonneD avatar May 05 '17 21:05 YvonneD

When creating the modal div, just add data-add-x="5" to move the modal by 5 pixels to the right or data-add-y="-5" to move it 5 pixels to the left.

On your trigger you can use data-add-anchor-x="5" to move the arrow right by 5 pixels or data-add-anchor-x="-5" to move it left by 5 pixels.

You can of course use any number and the same goes for -y.

bluefirex avatar May 07 '17 19:05 bluefirex

Thanks. I've tryied these atrributes. data-add-x works well.But data-add-anchor-x seems not work on my test. Could you please check out my codepen demo,Thanks.

See the Pen SweetDropdown.js---Versatile dropdowns for any occasion by Yifang Di (@diyifang) on CodePen.

YvonneD avatar May 08 '17 22:05 YvonneD

Question:

How can i use the same dropdown on different buttons and just change its contents and position? Does this not have a detachAll method to remove on all components attached to it?

Mashiane avatar Mar 04 '19 11:03 Mashiane