sweet-dropdown
sweet-dropdown copied to clipboard
data-add-x data-add-anchor-x how to use
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.
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
.
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.
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?