0
无尽的搜索后,我希望得到这个想法。基本上我需要一个脚本并在浏览器窗口调整大小时重新启动它。我只知道JS有足够的危险性。重置浏览器上的jQuery脚本调整大小
该脚本是在响应模板中的非响应滑块。目前,根据窗口初始加载的分辨率,脚本会更改其输出并进行适当的显示。但是,如果您调整窗口大小,脚本会变得疯狂并且看起来很糟糕。
我宁愿能够重写脚本以侦听调整大小并重新计算大小,但不幸的是,根据我的知识,承担工作将会是压倒性的。我希望通过重新启动脚本来达到类似的结果。
这是当幻灯片被称为:
$(document).ready(function()
{
$("#showcase").awShowcase(
{
content_height: 640,
fit_to_parent: true,
auto: false,
interval: 5000,
continuous: true,
loading: true,
tooltip_width: 200,
tooltip_icon_width: 32,
tooltip_icon_height: 32,
tooltip_offsetx: 18,
tooltip_offsety: 0,
arrows: true,
buttons: false,
btn_numbers: true,
keybord_keys: true,
mousetrace: false, /* Trace x and y coordinates for the mouse */
pauseonover: true,
stoponclick: false,
transition: 'hslide', /* hslide/vslide/fade */
transition_speed: 500,
transition_delay: 300,
show_caption: 'show', /* onload/onhover/show */
thumbnails: true,
thumbnails_position: 'outside-last', /* outside-last/outside-first/inside-last/inside-first */
thumbnails_direction: 'horizontal', /* vertical/horizontal */
thumbnails_slidex: 0, /* 0 = auto/1 = slide one thumbnail/2 = slide two thumbnails/etc. */
dynamic_height: true, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
speed_change: false, /* Set to true to prevent users from swithing more then one slide at once. */
viewline: true /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. It's OK with only the width. */
});
});
我也有在地方检测的窗口大小调整,等待150ms的代码,但后来我迷路了。
var resizeTimer;
$(window).resize(function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
}, 150);
});
设置它你所提到的没有做的方式技巧..虽然它再次运行该功能,但它不能在页面上正常运行。似乎我需要重置在重新设置和重新运行之前初始运行所做的任何更改? –
更新了我的答案。 – manishie