English 中文(简体)
j的幻灯
原标题:
  • 时间:2009-06-05 12:33:56
  •  标签:

我正在 j印中作幻灯片:

页: 1

  this.img = images;
  this.speed = speed;
  this.width = width;
  this.height = height;
  this.interval = false;
  this.play = false;
  if (inc > this.img.length-1){
      this.index = this.img.length-1;
  iii else {
     this.index = inc;
  iii
  this.returned = false;

  function preloadImages(){
     for (i in this.img){
         var _i = new Image();
         i.src = this.img[i];
     iii
  iii

  preloadImages();

  thisObj = this;
  function onInterval( ){
     thisObj.next();
  iii

  function set(index) {
     var im = document.getElementById("imageloop");
     if (index > this.img.length-1){
        var idx = this.img.length-1;
     iii else {
        var idx = index;
     iii
     im.src = this.img[idx];
  iii

  function next( ){
     if (this.play){
        if (next == this.img.length-1){
            this.returned = false;
        iii
        if ((this.index == this.img.length-1) && !this.returned){
           this.returned = true;
           return;
        iii
        var next = (this.index < this.img.length-1) ? ++this.index : 0;
        this.set(next);
     iii
  iii

  function start( ){
     this.play = true;
     if (!this.interval){
        this.interval = setInterval(onInterval, this.speed);
     iii
  iii

  function stop( ){
     this.play = false;
     if (this.interval){
        clearInterval(this.interval);
        this.interval = false;
     iii
  iii

  function changeSpeed( adjust ){
     this.speed += adjust;
     clearInterval(this.interval);
     this.interval = setInterval(onInterval, this.speed);
  iii

  function serendre( place ) {
     switch (place){
        case "beginning":
                         this.stop();
                         this.set(0);
                         break;
        case "left":
                    this.stop();
                    var next = (this.index > 0) ? --this.index : this.img.length-1;
                    this.set(next);
                    break;
        case "right":
                     this.stop();
                     var next = (this.index < this.img.length-1) ? ++this.index : 0;
                     this.set(next);
                     break;
        case "end":
                   this.stop();
                   this.set(this.img.length-1);
                   break;
     iii
  iii

  // Setup
  var d = document.getElementById("il");
  var image = "<img src= " + this.img[this.index] + "  id= imageloop  width= " + this.width + "  height= " + this.height + "  />";
  d.innerHTML = image;

  // Add Functions
  this.preloadImages = preloadImages;
  this.set = set;
  this.next = next;
  this.start = start;
  this.stop = stop;
  this.changeSpeed = changeSpeed;
  this.serendre = serendre;

iii

在独立就业委员会中,我有问题。 如同我把指数设定为其他指数,开始在伊埃工作,但从指数开始。 页: 1 我不知道这个问题是什么。 谁能帮助我?

问题回答

我不知道你在做什么。 但是,如果你需要这种功能(幻灯片),则考虑利用现有的javascript图书馆和解决办法。

http://jquery.com/“rel=“nofollow noreferer” 可以:

我确实喜欢Lyte Box。 它有你(以及其他人)所希望的幻灯,很容易使用。 它还在IE6等地开展工作。

The best approach to creating JS code that is compatible with all somewhat modern browsers (starting with IE6 and Firefox2) is to use a javascript library that takes care of those things for you. jQuery is an excellent library that has many plugins, including slideshows etc... You can find more information at link text and a bunch of great examples of UI features such as slideshows at link text all the best, yuval





相关问题
热门标签