Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

焦点轮播图自动播放特效(demo.html文件) #2

Open
zlluGitHub opened this issue Apr 10, 2018 · 0 comments
Open

焦点轮播图自动播放特效(demo.html文件) #2

zlluGitHub opened this issue Apr 10, 2018 · 0 comments

Comments

@zlluGitHub
Copy link
Owner

  • 获取轮播图触发事件id值,注意待页面加载完后执行:window.onload=function(){}
  var next=document.getElementById('next');
  
  var list=document.getElementById('list');
  
  var prev=document.getElementById('prev');
  
  var contains=document.getElementById('container');
  
  var buttons=document.getElementById('buttons').getElementsByTagName('span');
  • 注意: id 与标签连用时id可以看做是一个数组名:

      for(var i = 0;i < buttons.length;i++) 与 buttons[i].className == 'on'
    
  • 循环执行定时器timestime:

      var times=setInterval(function(){next.onclick();},2500);
    
  • 获取自定义属性:

      var myIndex=parseInt(this.getAttribute('index'));
    
  • 取整函数:

      var newleft=parseInt(list.style.left);
    
  • 标签a无超链接指向地址时可以这样写:

     <a href="javascript:;" >文本</a> 
    
  • 全部代码请点击这里...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant