简体   繁体   中英

How to use jQuery-UI drag and drop with two divs containing elements of identical ids

I have common jQuery function for drag and drop and two div tags. Both div tags have different ids but both containing elements of identical ids. I have a block and a placeholder for each so when i drag 'block1' olny placeholder of first table should be blink and but both are blinking. Same for block2 when i drag block2 only placeholder of second table should be blink and placeholder of first table should accept only block1 and same for placeholder of second table.I have implemented common function but it's not working. when i am dragging any block both placeholders are blinking and both placeholders are accepting the block.

Here's link to my fiddle - jsfiddle.net/2pFqe/3/

In fiddle i have two divs of id, 'id1' and 'id2' both containing elements of same id. Now when i drag block1 both placeholders are blinking. I have tried .filter(:first), eq(0) but no solution

Is there any way to do this??

Please help me to sort out this.

Regards.

使用jQuery通配符选择器$("[id^=block]")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM