[orginal]checkBox based on web(thinking in & implementation)
2009-09-23 09:12
337 查看
structure: the checkbox from physical point of view is two images( checked and unchecked) ,with caption text.
Code
function changeState( element ,height ,statNumber)
{
//statNumber the number of state we want to show currently
// elemnt is imageBackground for span
/// 0: normal status,1 mouseMove status,2 mousepress status, 3 fucuse,4 disable ,5 no
var top=height*statNumber;
// alert('100% -'+left+'px');
document.getElementById(element).style.backgroundPosition='100% -'+top+'px';
}
here you go the result:
Code
function changeState( element ,height ,statNumber)
{
//statNumber the number of state we want to show currently
// elemnt is imageBackground for span
/// 0: normal status,1 mouseMove status,2 mousepress status, 3 fucuse,4 disable ,5 no
var top=height*statNumber;
// alert('100% -'+left+'px');
document.getElementById(element).style.backgroundPosition='100% -'+top+'px';
}
here you go the result:
![](http://images.cnblogs.com/cnblogs_com/ammar/res.png)
相关文章推荐
- [orginal] OOP group Box control based on WEB.!!!
- [orginal] slide bar based on web , from ABC
- [orginal]Combolist visual design & and implementation ( based on css ,js and html)
- [ORGINAL]OOP Panel control design(based on web )
- A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python)
- A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python)
- [orginal]treeView control based on WEB
- A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python)
- Issue of weblogic [Servlet: "action" failed to preload on startup in Web application]
- JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Javascript & CSS gotchas in Mobile Web App Development
- webkitdriver - WebDriver implementation for a headless/embedded WebKit based browser - Google Project Hosting
- Non-ASCII character '\xe8' in file xxx.py on line 8, but no encoding declared
- Custom ThreadPool in Java to Perform as ThreadPool in C# based on Singleton Model
- Initialization & Cleanup(Chapter 6 of Thinking in C++)
- update records in one table based on values in another table
- SSH based on Web Technology
- What is load on startup element in web.xml file
- “Sharing Position with Friends” in MGE based Web GIS Application
- Cluster Implementation Based On RHEL