【问题标题】:CSS how is width getting set?CSS如何设置宽度?
【发布时间】:2015-11-13 13:57:01
【问题描述】:

我继承了一个包含幻灯片的网页,但我不知道如何更改包含幻灯片的<article> 的宽度。我认为它是通过 JavaScript 获得大小的,但我已经搜索过并且无法弄清楚在哪里。

如果您在页面上查看源代码,您将不会在文章标签中看到宽度,但如果您使用 firebug 查看样式,您会看到:

element.style {
  width: 565px;
}

我在这里发布了一个示例版本:http://208.112.58.198/help/index_new.htm。

【问题讨论】:

  • 我现在看到幻灯片的宽度是响应式的并且是从父元素级联的。目标是让幻灯片全屏显示,但我仍然不明白为什么它没有填满屏幕。

标签: javascript jquery html css slideshow


【解决方案1】:

jquery plugin 正在应用您元素的 CSS 宽度。

/help/wp-content/themes/Cobalt3/cobalt/js/main68b3.js这个文件行号#339有如下代码。

$('#part-slideshow').carouFredSel({
    height: 300,
    width: '100%',
    circular: true,
    items: {
        visible: 1,
        height: 300,
    },
    scroll: {
        items: 1,
        fx: "crossfade",
        duration: 1000,
        easing: "swing"
    },
    auto: {
        timeoutDuration: 5000,
        delay: 5000,
        pauseOnHover: true
    },
    pagination: '#pagination',
    swipe: {
        onTouch: true,
        onMouse: true
    },
    responsive: true
});

插件将resize 事件函数绑定到轮播元素,这会根据屏幕大小设置元素宽度,因为在调用中添加了responsive: true 选项。

【讨论】:

    猜你喜欢
    • 2011-08-24
    • 1970-01-01
    • 2019-03-09
    • 2016-05-30
    • 1970-01-01
    • 2015-07-28
    • 2015-08-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多