gpt4 book ai didi

4 个方向的 jQuery 全屏幻灯片

转载 作者:行者123 更新时间:2023-11-28 18:44:34 26 4
gpt4 key购买 nike

简单的问题,但回答起来可能更难。我无法计算出对此 http://www.socketstudios.com/ 的影响地点。它基本上是响应式和全屏显示。有 scrollTo 插件,它不再可用,所以我正在寻找替代方案,因为我不确定它是否是导致效果的原因,即使是,如果您需要更多插件。

最佳答案

为了调整图像的大小,他们使用了一个脚本来监听 resize 事件。

$(window).resize(function() {             
var top_target = '#work'+current_section;
var $main = $('#main');
$main.scrollTo(top_target);

var i=0;
for (i=0;i<=15;i++)
{
var $container = $('#work'+i);
var left_target = '#workcontent1';
$container.scrollTo(left_target);
}


var left_target = '#workcontent'+current_image;
var $work_container = $('#work'+current_section);
$work_container.scrollTo(left_target);

// Get Window Size

var myWidth = 0, myHeight = 0;

myWidth = $(window).width();
myHeight = $(window).height();

if(myHeight >= 900){
image_height = 900;
image_width = 1350;
}
else{
image_height = myHeight;
image_width = image_height * 1.5;
}

// Set Image Offset

var $imgcont = $('.imgcontainer');

$imgcont.css('width', +image_width);
$imgcont.css('margin-top', +image_height / -2 + "px");
$imgcont.css('margin-left', +image_width / -2 + "px");
});

关于4 个方向的 jQuery 全屏幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10753557/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com