<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#语言,谢谢:

解决方案 »

  1.   

    还有一段。。
    <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>
      

  2.   

    javascript在客户端运行,c#在服务器端运行,两者所达到的任务不同,转过来也是无用的。
      

  3.   

    如果我不知道javascript的话,那这些功能我用C#不能实现么??
    我不懂那么多语言,刚开始学习的菜鸟,还在担心别丢了工作,辛苦哦
      

  4.   

    是的,单纯用C#是无法在网页中实现上述javascript的功能的。
    因为浏览器是不支持C#语言的,建议楼主去学习一下javascript吧,其实js和C#很像的
      

  5.   

    这个太累了看着难过,语言看起来差不多
    你就当javascript是c#语句,不懂的函数,你查一下javascript说明就知道了
    其他没有特别的
      

  6.   

    这个是要在JS下完成的,不需要转换成C#,我想以后你可能想尽量转成JS来实现。
      

  7.   

    javascript在客户端运行,c#在服务器端运行,两者所达到的任务不同,转过来也是无用的。
    ===================================================
    顶,支持Js,在客户端运行,是提供给客户使用,做Web开发的,Js是蛮重要的!建议楼主学习!