让SlideJS全屏工作 [英] Get SlideJS to work fullscreen

查看:78
本文介绍了让SlideJS全屏工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让SlideJS全屏工作失败......无论我做什么都看起来它周围有空白,它永远不适合。



我需要将FULL背景设置为SlideJS的滑块,以便背景每隔5秒滑动一次到下一页/幻灯片(这是一个带有欢迎来到我的网站等文本的块颜色。然后在下一张幻灯片上一个不同的块背景颜色,它可能会说我的名字是胡说,我是胡说八道。和每张幻灯片上的不同图标)。



当使用Superslides ,它似乎将每张幻灯片容器中放入的每张单独图像都设置为背景图像,我只希望改变每张幻灯片的背景的块颜色;而不是背景图片。

因此,我需要获得一个完整页面/屏幕滑动背景,让您在幻灯片中显示图像(与Superslides不同,因为它将它们设置为position:absolute; ...)。

解决方案

我碰到类似的情况。 / p>

这是我修复它的方法。



在源文件中查找这个函数(在第231行)并将宽度和高度变量更改为$(window).width();和.height();

$ b $ pre $ Plugin.prototype.update = function(){
var $ element,height,width ;
$ element = $(this.element);
this.data = $ .data(this);
$(。slidesjs-control,$ element).children(:not(:eq(+ this.data.current +)))。css({
display:无,
剩下:0,
zIndex:0
});
width = $(window).width();
height = $(window).height();
return $(。slidesjs-control,.slidesjs-container,$ element).css({
width:width,
height:height
});
};


I've failed at trying to get SlideJS to work fullscreen... It seems to have whitespace around it no matter what I do and it never fits.

I need the FULL background to be like SlideJS's slider, so that the background slides every 5 seconds to the next page/slide (which is a block color with some text such as "Welcome to my site." then on the next slide, with a different block background color it may say "My name is blah and I blah blah." and a different icon on each slide).

When using a plugin such as Superslides, it seems to set EVERY single images that I put in each slide container as the background image, I only want a block color for the background which changes each slide; not an image as the background.

So, I need to get a full-page/screen sliding background which lets you have images inside the slides (unlike Superslides which doesn't as it sets them to "position: absolute; ...").

解决方案

I ran into a similar situation.

This is what I did to fix it.

Look for this function in the source (around line 231) and change the width and height variables to $(window).width(); and .height(); :

Plugin.prototype.update = function() {
  var $element, height, width;
  $element = $(this.element);
  this.data = $.data(this);
  $(".slidesjs-control", $element).children(":not(:eq(" + this.data.current + "))").css({
    display: "none",
    left: 0,
    zIndex: 0
  });
  width = $(window).width();
  height = $(window).height();
  return $(".slidesjs-control, .slidesjs-container", $element).css({
    width: width,
    height: height
  });
};

这篇关于让SlideJS全屏工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆