Stop Repeating my code, better solution for dragging?
Hi,
I have 16 divs which contain 16 images, one in each. My code is below and my question is is there a better way to do this. My problem is each div has its own class to format it. Maybe in my css I use an element for each div and one class.
- $(
'#divCleanTool1').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool2').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool3').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool4').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool5').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool6').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool7').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool8').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool9').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool10').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool11').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool12').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool13').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool14').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool15').draggable({ helper: "clone",
cursor:
"move"
});$(
'#divCleanTool16').draggable({ helper: "clone",
cursor:
"move"
});
As you can see it is repeated many time, any help please?
Jiggy!