jquery代码

$(document).ready(function(){  
  //$(".trclass:odd>td").addClass("tr1");
  $(".trclass:even>td").addClass("tr2");
  $(".trclass>td").mouseover(function(){
      $(this).siblings().addClass("tr3");
    $(this).addClass("tr4");
    }).mouseout(function(){
    $(this).siblings().removeClass("tr3");
    $(this).removeClass("tr4");
      });
  

    });

Tags:
这个就是head里要放的代码
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function(){
    $("a[rel=external]").each(function(i){
        this.target="_blank";  
    });
});
</script>


然后把你原来有_blank给删除了,

换成这个


<a href="{lst['url']}" title="{lst['content']}" rel="external">{lst['title']}</a>


只要有jquery 就不用在为你的_blank烦恼了!
Tags: , ,
jQuery Select(单选) 模拟插件 V1.3.5

Quotation
08月29日更新 V1.3.5

a、修正safari下的样式问题
b、使用其他的方法生成select后面的下拉箭头
c、增加对鼠标滚轮的支持。
d、一些细节上的写法。



Demo:http://www.zhangjingwei.com/demo/jQuery.Select/index.html

您可以自由的使用这个开源项目在任何项目上。(商业、非商业)
希望您可以补充完善这个插件。

08年12月写的插件,好像有一些朋友在用,那个时候写的东西,现在看来写的很烂很烂,因为工作原因也没有时间去修改。
今天看到回复中的很多问题,兼并解决了一些,因为写的不好,所以各位使用者在遇到问题并修正后,还请直接回馈给我,我修改下。

插件勉强能用,多多包涵了,工作是在太忙了,3年了….


Tags:

JQuery 实现滚动体样式 不指定

Else , 2010/03/30 13:06 , JQuery资源 , Comments(1) , Reads(953) , Via Original
demo3的下载 http://www.uushare.com/user/cukunet/files/2799120

本站演示

有用到一个jq的插件


<script type="text/javascript" src="js/jquery.linscroll.js"></script>
<script type="text/javascript">
$(document).ready(
function(){
$("#scrollContent").setScroll( //scrollContent为滚动层的ID
  {img:"images/scroll_bk.gif",width:8},//背景图及其宽度
  {img:"images/scroll_arrow_up.gif",height:3},//up image
  {img:"images/scroll_arrow_down.gif",height:3},//down image
  {img:"images/scroll_bar.gif",height:25}//bar image
);
}
);  
</script>


ps:
这个例子也是同事ivy做的!

<script type="text/javascript">
$(function(){
  var x=10;
  var y=10;
  $("a.tooltip").mouseover(function(e){
    var tooltip="<div id='tooltip'><img src='"+this.href+"' alt='商品預覽圖'/></div>";
    $("body").append(tooltip);
    $("#tooltip").css({
      "top":(e.pageY+y)+"px","left":(e.pageX+x)+"px","position":"absolute","border":"1px solid #ccc","background":"#FFF"
    }).show("fast");
  }).mouseout(function(){
    $("#tooltip").remove();
  }).mousemove(function(e){
    $("#tooltip").css({
      "top":(e.pageY+y)+"px","left":(e.pageX+x)+"px"
  });
  });
});
</script>


查看例子

jquery ajax删除的例子 不指定

Else , 2010/03/30 01:36 , JQuery资源 , Comments(4) , Reads(1291) , Via Original
删除的例子,有两部,一是以看到的,二是看不到的

可以看到的是我们点了之后,要删除的那一行没了

并提示我们 某某删除成功,先不做php的部分


<script type="text/javascript" src="http://www.aixq.com/js/jquery.js"></script>
<script type="text/javascript">


/**
函数名 msgdel
参数 ids
作用 删除
其它 remove() 可以参考手册

**/
function msgdel(ids)
{
$("#tr"+ids).remove();
/**
这里用来向服务器提交,文件名叫ajax.php
**/
$("#msg").html(ids+"删除成功");
}
</script>

查看例子
这个是判断修改密码是否打勾
FormValid 这个是志凡写的表单验证的js
Open in new window
Tags: ,
加一個省事的回調
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* www.sofut.com mysite
* www.aixq.com blog
*/
function ajaxsend(actset,inputid,showmsg)
{
    $.ajax({
        beforeSend:function(){
            $("#msg").html("正在建立链接..");
        },
        dataType:"json",
        type: "post",
        url:"ajax.php?act="+actset,
        data: $("#"+inputid+" :input").serialize(),
        success: function(json){
          
            if(json.msg)
            {
                if(showmsg)
                {
                    alert(json.msg);
                }
                $("input[type=reset]").click();
                $("#msg").html(json.msg);
                if($("#loadbody").text()!="")
                {
                    $("#loadbody").load(window.location.href+"?"+Math.random()+" #loadbody",function(){});
                }
            }
            else
            {
                alert(json.error);
                $("#msg").html(json.error);
                  

            }
          
        },
        error:function(){
            $("#msg").html("链接出错");
        }
    });
}


Tags: ,

$(function(){
    setTimeout("marquee(2,168,12)",2000);
    $("#NewProduct").hover(function(){
        if (Stag=="stop"){
       clearTimeout(timera);
     }
    },function(){
     if (Stag=="stop"){
      timera=setTimeout("marquee(2,168,12)",1000);
     }
   })
})
Tags:
本文没有全部代码只是思路

在项目中,

产成的json是两个部分组成的代码

一个是分页中的资料集,

另一个是分页的信息,还有一些统计放到里面

[{"id":"2","id":"3"},{"page":"1","pirce":"20"}]

这样返回的数组的长度减一,就是分页的数据

json最后一个就是分页的信息!

这样做的速度很快!
Tags: , ,
Pages: 1/4 First page 1 2 3 4 Next page Final page [ View by Articles | List ]