如何在javascript或jQuery中使用鼠标获得foreach($data as $dat){
foreach($dat as $key=>$da){
$_id = $key;
$sql = "SELECT l.name, p.bigimage
FROM `LocationsCategory` lc,
`NEProducts` p,
`LocationsCategoryJoin` lcj, `Locations` l
WHERE lcj.LocationsID = p.location
and p.location is not null
and l.LocationsID = lcj.LocationsID
and p.status = 1
and lcj.LocationsCategoryID = " . $_id;
$result = mysql_query($sql) or die ("ERROR");
$resultList = array();
while ($row = mysql_fetch_assoc($result)) {
//I will adding each key value pair here
$resultList[$row["name"]] = $row["bigimage"];
}
//I will save new constructed array in the marker**
$da[1] = $resultList;
}
}
(x,y)的场图像大小?
实施例:
我的页面中有一个图像,图像中有一些字段,当我在字段上单击并拖动鼠标时,我需要得到方形的points
。
这些是必要的,因为我会插入此
我研究了一些例子,但没找到。
答案 0 :(得分:0)
您的问题不明确,但如果您只是想要图像尺寸,可以这样做:
$(document).ready(function() {
var img = $('img');
img.removeAttr("width");
img.removeAttr("height");
alert( img.width() );
alert( img.height() );
});