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