jQuery循环插件,自定义分页选项卡

jQuery cycle plugin, customizing the pager tabbing

本文关键字:分页 选项 自定义 循环 插件 jQuery      更新时间:2023-09-26

我正在开发一个具有一些功能的模拟网站。我使用的是html css和js。我正在使用循环插件来循环浏览我制作的一些选项卡。我会发布我的代码,然后解释我试图做什么:

我的html:

 <div id="content">
  <div id="image_selector" class="image_selector">
    <div class ="image">
      <ul>
        <li><a id="Mpowered" href="">Mpowered</a></li>
        <li><a id="Technology" href="">Technology</a></li>
        <li><a id="Consulting" href="">Consulting</a></li>
        <li><a id="Outsourcing" href="">Outsourcing</a></li>
      </ul>
    </div>
  </div>
  <div class="cell">
   <div class="description">
      <img id="demoimg" src="/home/***/HTML/launch_pad/images/productivity.png" alt="demo pic"/>
      <h2>Who are we?</h2>
      <p> a consulting company... ect</p>
    </div>

    <div class="description">
      <img id="demoimg" src="/home/***/HTML/launch_pad/images/tech1.jpg" alt="tech"/>
      <h2>We have the tech!</h2>
      <p> lots of tech!!.... ect</p>
    </div>

还有两个描述部分,一个用于我现在作为选项卡制作的每个"a"标签。

css看起来像这样:

.image_selector {
  border: 1px dotted green;
  height: 130px;
}
.image li {
  float: left;
  border: 1px solid white;
  height: 100px;
  width: 103px;
  margin-left: 86px;
  overflow: hidden;
  text-align: center;
}
.image li a {
  padding: 74px 0px 0px 0px;
  color: white;
  text-shadow: 0 0 0.6em #0197E8;
  font-size: 17px;
  letter-spacing: 1px;
  text-decoration: none;
  display: block;
  height: 80px;
  background-repeat: no-repeat;
}
.image li a:hover {
  text-shadow: 0 0 0.6em #0197E8, 0 0 0.4em #0197E8, 0 0 0.6em #0197E8;
}

.image li #Mpowered {
  background-image: url('/home/ruberto/HTML/launch_pad/images/mpower.png');
  background-position: center top; 
}
.image li #Technology {
  background-image: url('/home/ruberto/HTML/launch_pad/images/tech.png'); 
  background-position: center top; 
}
.image li #Consulting {
  background-image: url('/home/ruberto/HTML/launch_pad/images/consulting.png'); 
  background-position: center top; 
}
.image li #Outsourcing {
   background-image: url('/home/ruberto/HTML/launch_pad/images/outsourcing.png'); 
   background-position: center top; 
}
.cell {
  border: 1px dashed green;
  height: 318px;
  width: 715px;
  float: left;
}
#demoimg {
  float: left;
  position: static;
  margin: 16px 8px 0px 0px;
  height: 200px;
  width: 200px;
}

和javascript iam使用:

$('.cell') 
.before('<div class="image">') 
.cycle({ 
    fx:     'turnDown', 
    speed:  'fast', 
    timeout: 0, 
    pager:  '.image' 
});

因此,我已经在线上阅读了内容,现在了解到pager选项现在将在div上方创建自己的导航部分,该div包含我想要旋转的内容。我想知道有没有一种方法可以引用我为单元格类的导航函数设置的"image"标记作为"tab"??

如果没有办法,任何人都可以推荐一些可以代替它的东西?

假设您想引用甚至将这些li映射到其他功能,甚至构建另一个可引用的寻呼机(听起来可能需要这样做),那么您可能需要.index来为这些对连接提供引用。

要启动一个重复的寻呼机,可以在其他地方克隆这些元素,然后可以简单地使用css不显示原始元素,但将其保留在原位,以便循环可以使用它进行寻呼//创建辅助菜单$('#pager').fund('li').clone().appendTo('#navpage ul');

然后,如果你想配对你的两个寻呼机,从这个功能开始http://jsfiddle.net/moneylotion/KhL3W/