日期:2014-05-17  浏览次数:20752 次

少用但实用js和css整理中

控制字符长度过长换行:<TD style="vertical-align:top; COLOR: #333; BORDER-BOTTOM: #e3deb8 2px solid;BORDER-RIGHT: #e3deb8 2px solid;word-wrap:break-word;overflow:auto;" class="dataCell" scope=row>

?

<TD class="dataCell" style="vertical-align:top; COLOR: #333; BORDER-BOTTOM: #e3deb8 2px solid;BORDER-RIGHT: #e3deb8 2px solid;">

鼠标在表格上移动变色:<TR class=" dataRow even first"

onblur="if (window.hiOff){hiOff(this);}"

onmouseover="if (window.hiOn){hiOn(this);}"

onfocus="if (window.hiOn){hiOn(this);}"

onmouseout="if (window.hiOff){hiOff(this);}" id="dd">,页面数据多好像会很慢

或者

#DataGrid1 tr {
cursor:hand;
height:20px;
background-color: expression(this.sectionRowIndex % 2 == 0 ? "#EEF3F7" : "#F0F0FF" );
TableSelect: expression(
onmouseover = function()
{
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" : (this.sectionRowIndex % 2 == 0 ? "#EEF3F7" : "#F0F0FF")
);
},
onmouseout = function()
{
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :(this.sectionRowIndex % 2 == 0 ? "#EEF3F7" : "#F0F0FF")
)
}
);
}

?

select多选控制

<script>
var tempMatch = new Array();
var tempNoMatch = new Array();
var count=0;
var mark=false;
function matchMoveselect(matchedId){?
? ? var matched = document.getElementById(matchedId);?
? ? var temp = new Array();
? ? var j=0;? ?
? ? if(count==0){
? ? ? ? for(i=0;i <matched.options.length;i++){
? ? ? ? ? ? tempMatch[i]=new Option(matched.options[i].text,matched.options[i].value);? ? ? ? ? ? ?
? ? ? ? }? ? ? ?
? ? }
? ? count++;
? ? for(i=0;i <matched.options.length;i++){
? ? ? ? if(matched.options[i].selected){
? ? ? ? ? ? mark=true;
? ? ? ? ? ? //noMatched.options[noMatched.options.length]=new Option(matched.options[i].text,matched.options[i].value);
? ? ? ? ? ? temp[j]=i;? ? ?
? ? ? ? ? ? j++;
? ? ? ? }? ? ?
? ? }
? ? for(i=0;i <=temp.length;i++)? ? {
? ? ? ? matched.options[temp[i]-i]=null;?
? ? }?
? ?
}

</script>

/*添加select模板参考

var sAgent = navigator.userAgent.toLowerCase() ;
?
? ? // Internet Explorer
? ? if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
? ? {
? ? ? ? if(flag){?
? ? ? ? ? ? var sleold=oldstr.options.length;? ? ? ? ? ?
? ? ? ? ? ? ? var slenew=vect.size();
? ? ? ? ? ? oldstr.options.length=0;? ? ?
? ? ? ? ? ? for(var i=0;i <slenew;i++){
? ? ? ? ? ? ? ? var moPtion=window.opener.document.createElement("OPTION");? ? ?
? ? ? ? ? ? ? ? moPtion.text=map.get(vect.get(i));? ? ? ? ? ?
? ? ? ? ? ? ? ? moPtion.value=vect.get(i);
? ? ? ? ? ? ? ? if(!oldstr.contains(moPtion)){
? ? ? ? ? ? ? ? ? ? oldstr.add(moPtion);?
? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? }? ? ?
? ? ? ? }
? ? }else{
? ? ? ? if(flag){? ? ?
? ? ? ? ? ? var slenew=vect.size();? ? ?
? ? ? ? ? ? for(var i=0;i <slenew;i++){? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? oldstr.options[i]=new Option(map.get(vect.get(i)),vect.get(i));? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? }? ? ?
? ? ? ? ? }
? ? }

*/end

<select name="signatory" ondblclick="matchMoveselect('selFile');"? multiple="multiple" style="width:300" id="selFile">

<option value="100">Winston , </option>

</select>


<input name="rightMove" type="button" class="button"
? ? ? ? ? ? ? ? ? value="Remove" onClick="matchMoveselect('selFile');">

?