other(3).js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. var timer;
  2. var offset = 0;
  3. $(function () {
  4. $(".cont .wr #cont .slid .shoplist>li").hover(function () {
  5. var t = $(this).index()+"px";
  6. $(this).children().css("display","block")
  7. .css("top",t).css("left","210px");
  8. },function () {
  9. $(this).children().css("display","none");
  10. $(this).children().hover(function () {
  11. },function () {
  12. $(this).css("display","none");
  13. });
  14. });
  15. autoplay();
  16. $(".cont .wr #cont .lunbo .imglist").hover(function () {
  17. clearInterval(timer);
  18. },function () {
  19. autoplay();
  20. });
  21. $(".cont .wr #cont .selectli .ullist>li").hover(function () {
  22. var i = $(this).index();
  23. $(".cont .wr #cont .lunbo>.imglist").css("marginLeft",-633 *i);
  24. clearInterval(timer);
  25. },function () {
  26. var i = $(this).index();
  27. offset = -633 *i;
  28. autoplay();
  29. });
  30. $("#open").click(function () {
  31. $("#close").css("display","block");
  32. $("#open").css("display","none");
  33. $(this).parent().children(".shoplist").css("height","600px");
  34. $(".cont .wr #cont .slid .shoplist>li:nth-child(n+10)").css("display","block");
  35. });
  36. $("#close").click(function () {
  37. $("#open").css("display","block");
  38. $("#close").css("display","none");
  39. $(this).parent().children(".shoplist").css("height","300px");
  40. $(".cont .wr #cont .slid .shoplist>li:nth-child(n+10)").css("display","none");
  41. });
  42. });
  43. function autoplay() {
  44. clearInterval(timer);
  45. timer = setInterval(function () {
  46. offset -= 10;
  47. if (offset<=-2560){
  48. offset = 0;
  49. }
  50. $(".cont .wr #cont .lunbo .imglist").css("marginLeft",offset);
  51. },50);
  52. }