我有jsfiddle如下:
map.addOverlay(new ol.Overlay({
position: divLoc,
element: $("<div/>").attr("id", "pt_" + cityName).attr("box", "#dv" + cityName).addClass(colV + " mapMarker markerActive").on("mousedown", function (e) {
console.log("clicked maker");
console.log(e);
var targetObj = e.target.tagName.toLowerCase();
// not let boxes close
if (targetObj == "td" || targetObj == "tr" || targetObj == "table" || targetObj == "th" || e.target.className.indexOf("mapDivs") > 0) {
// load highcharts dont close box
// alert("load highchart data from here");
return -1;
}
// var box = $("#" + e.
$($(this).attr("box")).toggle(); // this will show / hide box
$(this).toggleClass("markerActive"); // this will apply style to marker
console.log($($(this).attr("box")));
}).append($("<div/>").addClass("mapDivs row " + colV).attr("id", "dv" + cityName).append(boxTable).draggable())
}))
http://jsfiddle.net/gawaliswapnil1/34g4c1c7/1/
我想移动盒子,然后添加可拖动的功能,它很好, 但现在css的变化并没有奏效。 任何帮助将不胜感激。
谢谢