如何在同一个地方设置展开和折叠图标 [英] how to set expand and collapse icon in same place

查看:218
本文介绍了如何在同一个地方设置展开和折叠图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://i.stack.imgur.com/iADOU.png

 Description:
                above image will give some details. in my table i want expand and collapse in same place.if we use MVC we edit the code in INDEX code page. where we write code in index page how i set both icon +.- in samer place

推荐答案

您是否只是将图像按钮ImageURL属性或图像的src属性更改为点击事件中的新图标?



类似于:

fyi我是一个不是mvc的asp.net家伙所以这个例子对你正在做的事情可能不正确



protected button_click(object sender,EventArgs e)

{

if(img.ImageUrl.IndexOf(plus)> -1)/ /或者有一些其他标志来确定要显示的图标

img.ImageUrl = {减去图标的路径}

else

img.ImageUrl = {路径加上图标}



//...do其他按钮事件的东西



}



再次它可能无法在mvc中运行,我还没有开始玩它但你应该明白了。
Cant you just change the image buttons ImageURL property or the src attribute of the image to be the new icon in the on click event?

something like:
fyi i'm an asp.net guy not mvc so the example may not be correct for what you're doing

protected button_click(object sender, EventArgs e)
{
if(img.ImageUrl.IndexOf("plus") > -1)//or have some other flag to determine which icon to show
img.ImageUrl = {path to minus icon}
else
img.ImageUrl = {path to plus icon}

//...do other button event stuff

}

again it may not work in mvc, i havent started playing with it yet but you should get the idea.


引用此链接来管理使用javascript的可折叠内容功能 http://stackoverflow.com/questions/17268006/expand -and-collapse-using-javascript-with-and?rq = 1 [ ^ ]
refer this link for manage collapsible content using javascript functionhttp://stackoverflow.com/questions/17268006/expand-and-collapse-using-javascript-with-and?rq=1[^]


这篇关于如何在同一个地方设置展开和折叠图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆