123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- $(function () {
- $(".datagrid-cell-c1-itembtn span input[type=checkbox]").click(function () {
- $(this).attr("checked", true);
- });
- $("#add").click(function () {
- $(".inp").slideDown(1000);
- });
- $("#edit").click(function () {
- $(".editinp").slideDown(1000);
- if ($(".tab tr td input[type=checkbox]").is(":checked")) {
- var iinfo = $(".tab tr td input[type=checkbox]:checked")
- .parent().next(".i").text();
- $(".editinp h3 span").text("id = "+iinfo);
- var t0 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(1).text();
- var t1 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(2).text();
- var t2 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(3).text();
- var t3 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(4).text();
- var t4 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(5).text();
- var t5 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(6).text();
- var t6 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(7).text();
- var t7 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(8).text();
- var t8 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(9).text();
- var t9 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(10).text();
- var t10 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(11).text();
- var t11 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(12).text();
- $(".editinp input[type=text]").eq(0).val(t0);
- $(".editinp input[type=text]").eq(1).val(t1);
- $(".editinp input[type=text]").eq(2).val(t2);
- $(".editinp input[type=text]").eq(3).val(t3);
- $(".editinp input[type=text]").eq(4).val(t4);
- $(".editinp input[type=text]").eq(5).val(t5);
- $(".editinp input[type=text]").eq(6).val(t6);
- $(".editinp input[type=text]").eq(7).val(t7);
- $(".editinp input[type=text]").eq(8).val(t8);
- $(".editinp input[type=text]").eq(9).val(t9);
- $(".editinp input[type=text]").eq(10).val(t10);
- $(".editinp input[type=text]").eq(11).val(t11);
- }
- });
- $("#sub").click(function () {
- var i1 = $(".inp input[type=text]").eq(0).val();
- var i2 = $(".inp input[type=text]").eq(1).val();
- var i3 = $(".inp input[type=text]").eq(2).val();
- var f1 = $(".inp input[type=file]").val();
- var filename = getFileName(f1);
- $(".inp").submit();
- $(".inp").slideUp(1000);
- });
- $("#editsub").click(function () {
- // console.log($(".tab tr td input[type=checkbox]").is(":checked"));
- $(".editinp").submit();
- $(".editinp").slideUp(1000);
- });
- $("#del").click(function () {
- $(".delinp").slideDown(1000);
- if ($(".tab tr td input[type=checkbox]").is(":checked")) {
- var iinfo = $(".tab tr td input[type=checkbox]:checked")
- .parent().next(".i").text();
- $(".delinp h3 span").text(iinfo);
- $(".delinp input[type=text]").val(iinfo);
- }
- $("#su").submit(function () {
- $(".delinp").slideUp(1000);
- })
- });
- });
- function getFileName(o){
- var pos=o.lastIndexOf("\\");
- return o.substring(pos+1);
- }
- var timer;
- var offset = 0;
- $(function () {
- $(".cont .wr #cont .slid .shoplist>li").hover(function () {
- var t = $(this).index()+"px";
- $(this).children().css("display","block")
- .css("top",t).css("left","210px");
- },function () {
- $(this).children().css("display","none");
- $(this).children().hover(function () {
- },function () {
- $(this).css("display","none");
- });
- });
- autoplay();
- $(".cont .wr #cont .lunbo .imglist").hover(function () {
- clearInterval(timer);
- },function () {
- autoplay();
- });
- $(".cont .wr #cont .selectli .ullist>li").hover(function () {
- var i = $(this).index();
- $(".cont .wr #cont .lunbo>.imglist").css("marginLeft",-633 *i);
- clearInterval(timer);
- },function () {
- var i = $(this).index();
- offset = -633 *i;
- autoplay();
- });
- $("#open").click(function () {
- $("#close").css("display","block");
- $("#open").css("display","none");
- $(this).parent().children(".shoplist").css("height","600px");
- $(".cont .wr #cont .slid .shoplist>li:nth-child(n+10)").css("display","block");
- });
- $("#close").click(function () {
- $("#open").css("display","block");
- $("#close").css("display","none");
- $(this).parent().children(".shoplist").css("height","300px");
- $(".cont .wr #cont .slid .shoplist>li:nth-child(n+10)").css("display","none");
- });
- });
- function autoplay() {
- clearInterval(timer);
- timer = setInterval(function () {
- offset -= 10;
- if (offset<=-2560){
- offset = 0;
- }
- $(".cont .wr #cont .lunbo .imglist").css("marginLeft",offset);
- },50);
- }
|