Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Complex logical test on drag to test dragged item against dropzone attributes

Kevin R:

I have a list of divs in a container. I already have dragula set up and working. Each of these divs has data attributes: data-age, data-gender, data-grade. Not all divs will have all the Attributes.


fullname="Sophie Kurtis" data-name="Kurtis" data-age="10" data-
gender="2" data-grade="6" class="well persondiv" style="margin-
bottom:2px; padding:5px;">...


For Drop zones I have divs that also have some/all/none of the following data attributes: data-gender, data-gradestart, data-gradend, data-agestart, data-ageend.


data-gradestart="12" data-gradeend="10" data-agestart="" data-
ageend="">...


Because the items and the drop zone are created dynamically, I can't say if every data attribute will always be present on the person or the memberlist drop zone.

I am trying to create an .on('drag',function(source){}) that will set up tests with the filters present on the group and run the matching person data attributes through the test and fail if any of them fails.


persondiv data-gender == memberslist data-gender
persondiv data-age between memberslist data-agestart and data-ageend
persondiv data-grade(number) between memberslist data-gradestart and data-gradeend

Unfortunately I can't wrap my head around this to know where to start.



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Complex logical test on drag to test dragged item against dropzone attributes

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×