样式复选框(应用图像) [英] Styling Checkboxes (Applying Image)

查看:54
本文介绍了样式复选框(应用图像)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
问候.

我正在尝试设置复选框的样式(基本上是想应用图像).
我面临的主要障碍是所有控件都在GridView中,并且列是动态创建的.

我找到了一个解决方案rainFYT CSS和JS,它在某种程度上对问题进行了排序,但是又遇到了挑战,因为我正在使用XMLHTTP请求在每个Tick/untick上保存数据.

我真的被卡住了.

谁能帮忙.

在此先感谢

问候
Rahul More

Hello All,
Greetings.

I am trying to style the Checkboxes (basically wanted to apply the images).
The Major hurdle I am facing is all the Controls are in GridView and columns are created dynamically.

I found one solution rainFYT CSS and JS it sorted the problem to some extent but there is again challenge as I am using XMLHTTP request to save the data on each Tick/untick.

I am really badly stuck.

Can anyone please help.

Thanks in Advance

Regards
Rahul More

推荐答案

与按钮之类的某些控件不同,标准复选框控件并非设计为具有图像样式.你会在哪里贴一个?

但是,当显示一些使用复选框的基于图像的控件时,Web上存在一种实际做法.并且这些控件的行为符合逻辑,并且就像复选框一样被使用.

因此,您可以根据<img>元素自行创建此类控件.您需要至少有两个不同的位图才能显示控件的两个不同状态:选中和未选中.另外,您可以添加更多状态,例如,当鼠标悬停在元素上并且选中/取消选中它时-可能还需要另外两个状态.

该行为应基于JavaScript处理click和clickmouseovermouseout事件.处理程序应修改对象的状态并更改其外观,从而修改元素的src属性.

—SA
Unlike some controls like buttons, standard check box control is not designed to be styled with images. Where would you stick one?

However, there is a real practice on the Web, when some image-based controls are shown where the check boxes are used; and those controls behave logically and are used exactly like check boxes.

So, you can create such controls by yourself based on the <img> element. You need to have at least two different bitmaps to show two different states of the control: checked and unchecked. Also, you can add more states, for example, when a mouse is over the element and it''s is checked/unchecked — it would require two more.

The behavior should be based on JavaScript handling click and click, mouseover and mouseout events. The handler should modify the state of the object and change it appearance modifying the element''s src attribute.

—SA


这篇关于样式复选框(应用图像)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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