javascript高手进
JScript code:
<script language="javascript" type="text/javascript">
function $(e) {return document.getElementById(e);}
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
}
var MyMar;
var speed = 1; //速度,越大越慢
var spec = 1; //每次滚动的间距, 越大滚动越快
var ipath = 'images/home/'; //图片路径
var thumbs = document.getElementsByClassName('thumb_img');
for (var i=0; i<thumbs.length; i++) {
//thumbs[i].onmouseover = function () {$('main_img').src=this.rel; $('main_img').link=this.link;};
thumbs[i].onclick = function () {location = this.link}
}
//$('main_img').onclick = function () {location = this.link;}
$('gotop').onmouseover = function() {this.src = ipath + 'gotop.jpg'; MyMar=setInterval(gotop,speed);}
$('gotop').onmouseout = function() {this.src = ipath + 'gotop.jpg'; clearInterval(MyMar);}
$('gobottom').onmouseover = function() {this.src = ipath + 'gobottom.jpg'; MyMar=setInterval(gobottom,speed);}
$('gobottom').onmouseout = function() {this.src = ipath + 'gobottom.jpg'; clearInterval(MyMar);}
function gotop() {$('
相关问答:
<form id="form1" runat="server">
<div>
<script type="text/javascript">
function oo(a){
document.getEleme ......
我在学习中,碰到问题,在处理的时候希望用脚本代码去调用C#后台代码。怎么办?
ajax异步调用呗
ajax,
webservice
后台方法:
protected string CsharpVoid(string strCC)
{
strC ......
.cs文件里代码:
string ss="12345";
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "", " <scrip ......
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(),this.ClientID, " <script language=\"javascript\" type=\"text/javascript\"> if(confirm('需要直接 ......