Setting the left and top attributes of an clf = grid_search.best_estimator_.named_steps['svm']
print(clf.classes_)
element, or a svg
containing an div
element fails when the call comes from inside a mouse event.
I have created a jsFiddle to illustrate this. Demo HTML page below for reference. Tested in Chrome, Firefox and Safari.
Is this the expected behaviour of svg
elements?
I want to the user to be able to drag the svg
elements around. How can I achieve this?
svg
答案 0 :(得分:4)
You want header('Content-Type: text/html; charset=utf-8');
instead of event.target
:
this
$dot = $(this)
references the DOM element that initiated the event, in your case the event.target
inside the SVG.
In the other hand, <circle>
inside a jQuery event handler references the DOM element where the handler has been attached, that is, the this
element where the event has fired.