<script language="javascript">
var spreadWidth = "10";
function imgSpread_Click()
{
var img = document.getElementById("imgSpread");
if(img.title == "0")
{
if(spreadWidth == "*")
{
parent.fsFunc.cols = "185,0,*";
}
else
{
parent.fsFunc.cols = "185,*," + spreadWidth;
}
img.src = "images/btn_rightward.gif";
img.title = "1";
}
else if(img.title == "1")
{
parent.fsFunc.cols = "185,*,10";
img.src = "images/btn_leftward.gif"
img.title = "0";
}
}
</script>
实现一个伸缩按钮,javascript 我看不太懂,希望哪位帮忙翻译成C#语言,谢谢:
var spreadWidth = "10";
function imgSpread_Click()
{
var img = document.getElementById("imgSpread");
if(img.title == "0")
{
if(spreadWidth == "*")
{
parent.fsFunc.cols = "185,0,*";
}
else
{
parent.fsFunc.cols = "185,*," + spreadWidth;
}
img.src = "images/btn_rightward.gif";
img.title = "1";
}
else if(img.title == "1")
{
parent.fsFunc.cols = "185,*,10";
img.src = "images/btn_leftward.gif"
img.title = "0";
}
}
</script>
实现一个伸缩按钮,javascript 我看不太懂,希望哪位帮忙翻译成C#语言,谢谢:
<script language="javascript">
var pm = window.createPopup();
function popupMenu(x,y,h,w,div)
{
var db = pm.document.body;
db.innerHTML = div.innerHTML;
pm.show(x,y,w,h,document.body);
document.body.onmouseup = closePopup;
}
function closePopup()
{
pm.hide();
}
function setMapTool(tool)
{
var cvs = parent.fMap.cvs;
cvs.Operation = 0;
if(tool == "FullExtent")
{
parent.fMap.fullExtent();
}
else if(tool == "ZoomBox")
{
cvs.Operation = 131;
}
else if(tool == "ZoomIn")
{
cvs.Operation = 129;
}
else if(tool == "ZoomOut")
{
cvs.Operation = 130;
}
else if(tool == "Pan")
{
cvs.Operation = 132;
}
else if(tool == "Print")
{
cvs.Operation = 134;
}
else if(tool == "LayerControl")
{
//cvs.OpenLayersBox(100,400,0xfefefe,0x010101);
}
else if(tool == "MeasureLength")
{
cvs.Attrib("Op") = tool;
cvs.Operation = 33280;
closePopup();
}
else if(tool == "MeasureArea")
{
cvs.Attrib("Op") = tool;
cvs.Operation = 33536;
closePopup();
}
else if(tool == "ClearTracks")
{
cvs.TrackingLayer.Shapes.RemoveAll();
cvs.Layers.FindName("temp").Shapes.RemoveAll();
cvs.Refresh();
}
}
</script>
我不懂那么多语言,刚开始学习的菜鸟,还在担心别丢了工作,辛苦哦
因为浏览器是不支持C#语言的,建议楼主去学习一下javascript吧,其实js和C#很像的
你就当javascript是c#语句,不懂的函数,你查一下javascript说明就知道了
其他没有特别的
===================================================
顶,支持Js,在客户端运行,是提供给客户使用,做Web开发的,Js是蛮重要的!建议楼主学习!