(function(d) { function b(a, f) { return parseint(d.css(a[0], f)) || 0 } function u(a) { return a[0].offsetwidth + b(a, "marginleft") + b(a, "marginright") } function f(a) { return a[0].offsetheight + b(a, "margintop") + b(a, "marginbottom") } d.fn.jcarousellite = function(a) { a = d.extend({ btnprev: null, btnnext: null, btngo: null, mousewheel: !1, auto: null, speed: 1e3, easing: null, vertical: !1, circular: !0, visible: 5, start: 0, scroll: 5, beforestart: null, afterend: null }, a || {}); return this.each(function() { function b(b) { if (!q) { a.beforestart && a.beforestart.call(this, g.slice(e).slice(0, c)); if (a.circular) b <= a.start - c - 1 ? (h.css(p, -((k - 2 * c) * l) + "px"), e = b == a.start - c - 1 ? k - 2 * c - 1 : k - 2 * c - a.scroll) : b >= k - c + 1 ? (h.css(p, -(c * l) + "px"), e = b == k - c + 1 ? c + 1 : c + a.scroll) : e = b; else { if (0 > b || b > k - c) return; e = b } q = !0; h.animate("left" == p ? { left: -(e * l) } : { top: -(e * l) }, a.speed, a.easing, function() { a.afterend && a.afterend.call(this, g.slice(e).slice(0, c)); q = !1 }); a.circular || (d(a.btnprev + "," + a.btnnext).removeclass("disabled"), d(0 > e - a.scroll && a.btnprev || e + a.scroll > k - c && a.btnnext || []).addclass("disabled")) $("#h-scroll1119-con a").fancybox(); $("#h-scroll-con a").fancybox(); } return !1 } var q = !1, p = a.vertical ? "top" : "left", t = a.vertical ? "height" : "width", m = d(this), h = d("ul", m), n = d("li", h), r = n.size(), c = a.visible; a.circular && (h.prepend(n.slice(r - c - 1 + 1).clone()).append(n.slice(0, c).clone()), a.start += c); var g = d("li", h), k = g.size(), e = a.start; m.css("visibility", "visible"); g.css({ //overflow: "hidden", float: a.vertical ? "none" : "left" }); h.css({ margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1" }); m.css({ //overflow: "hidden", position: "relative", "z-index": "2", left: "0px" }); var l = a.vertical ? f(g) : u(g); n = l * k; r = l * c; g.css({ width: g.width(), height: g.height() }); h.css(t, n + "px").css(p, -(e * l)); m.css(t, r + "px"); a.btnprev && d(a.btnprev).click(function() { return b(e - a.scroll) }); a.btnnext && d(a.btnnext).click(function() { return b(e + a.scroll) }); a.btngo && d.each(a.btngo, function(c, e) { d(e).click(function() { return b(a.circular ? a.visible + c : c) }) }); a.mousewheel && m.mousewheel && m.mousewheel(function(c, d) { return 0 < d ? b(e - a.scroll) : b(e + a.scroll) }); a.auto && setinterval(function() { b(e + a.scroll) }, a.auto + a.speed) }) } })(jquery); $(function() { $("#h-scroll").jcarousellite({ btnnext: ".next", btnprev: ".prev", auto: 4500, speed: 500, }); $("#h-scroll1119").jcarousellite({ btnnext: ".next1119", btnprev: ".prev1119", auto: 4500, speed: 500, }); }); $(function() { //客户评价 $.ajax({ type: "post", url: "/zmcustomercommend/list", data: { type:0, currpage: 1, limit: 6 }, datatype: "json", success: function(d) { if (0 == d.code) { var b = ""; $.each(d.page.list, function(d, f) { b += '
  • ' + f.companyname + '

    ' + f.companyname + "
    " + f.customername + "
    " + f.commendcontent + "

  • " }); $("#h-scroll-1-con").html(b) $("#h-scroll-1").jcarousellite({ btnnext: ".next1", btnprev: ".prev1", scroll: 3, visible: 3 }) } else { alert(d.msg) } } }) /* $("#h-scroll-1").jcarousellite({ btnnext: ".next1", btnprev: ".prev1", scroll: 3, visible: 3 })*/ }); $(function() { //客户到访 $.ajax({ type: "get", url: "/customervisit/findlist/8", data: { currpage: 1, limit: 8 }, datatype: "json", success: function(d) { //console.log(d) if (0 == d.code) { var b = ""; $.each(d.zclist, function(d, f) { b += '
  • '+ ''+ ''+f.title+''+ '

    '; if(f.description.length>15){ b += f.description.substr(0,15)+'...'; }else{ b += f.description; } b += '

    '+ '
    '+ '
  • '; }); $("#h-scroll-2-con").html(b) $("#h-scroll-2").jcarousellite({ btnnext: ".next2", btnprev: ".prev2", scroll: 4, visible: 4 }) } else { alert(d.msg) } } }) /* $("#h-scroll-2").jcarousellite({ btnnext: ".next2", btnprev: ".prev2", scroll: 3, visible: 3 }) */ }); $(function() { $("#pro-scroll").jcarousellite({ btnnext: ".pro-next", btnprev: ".pro-prev", scroll: 5, visible: 5 }) }); $(function() { $("#pro-scroll2").jcarousellite({ btnnext: ".pro-next2", btnprev: ".pro-prev2", scroll: 5, visible: 5 }) });