javascript 控制css js控制 clss
像上面的一张图片我们该怎么用js 和css + div 很好的应用到我们的项目中呢?
<style>
.InpuRight{
height:20px;background:url(img/msg_bg.png) no-repeat;background-position:0px -250px;
}
.InputError{
width:20px;height:20px;background:url(img/msg_bg.png) no-repeat 0px 0px;
}
.inputLogin{
width:20px;height:20px;background:url(img/msg_bg.png) no-repeat;background-position:0px -150px;
}
</style>
定义的css样式,仔细看InputError和其它的区别你会明白很多
看看页面是怎么定义的呢:
<div id="ceshi" class="inputLogin"></div>
<a href="javascript:checkName()" >click</a>
再看看我们的js吧
function checkName(){
var uu = document.getElementById("ceshi");
uu.className="InpuRight";
uu.innerHTML=" <font color='red'>asdfdsf</font>";
}
看看我们的一开始运行吧
再看看click后的吧
小小的研究啊,用去了我半天的时间,悔恨当初没有好好的学啊!
相关文档:
首先是十个JS FRAMEWORK
jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
jquery UI
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
Chrome Frame
<script src=& ......
原文地址:http://www.devwebpro.com/25-rounded-corners-techniques-with-css/
* This post is regularly updated. *
Rounded corners is one of the most popular and frequently requested
CSS techniques even the father of internet Google
also launch the rounded corners style markup
with her Google Ad ......
Javascript实例:Select的OnChange()事件
我们用Select的onchange事件时,常会遇到这样一个问题,那就是连续选相同一项时,不触发onchange事件.你得有Change(改变),才能触发该事件
<select name=sel onchange="bao(this.options[this.options.selectedIndex].value)">
<option va ......
JavaScript操作服务器控件之Gridview控件
1.JavaScript脚本如下:
<script language="javascript" type="text/javascript">
function gridviewControl()
{
//获取GridView的客户端元素
  ......