我正在边缘动画中制作一个响应式网站滑动条,并且我为 1 张幻灯片制作了 2 张幻灯片(因此他们可以负责任地调整)。如果窗口宽度低于 786 像素,我希望第二张幻灯片显示,如果高于 786 像素,我希望显示第一张幻灯片。这是我使用的代码:
var n = $(window).width();
if (n > 768) {
// Show an Element.
// (sym.$("name") resolves an Edge Animate element name to a DOM
// element that can be used with jQuery)
sym.$("#panel_01_photo").show();
// Hide an Element.
// (sym.$("name") resolves an Edge Animate element name to a DOM
// element that can be used with jQuery)
sym.$("#panel_02_photo").hide();
}
else {
// Show an Element.
// (sym.$("name") resolves an Edge Animate element name to a DOM
// element that can be used with jQuery)
sym.$("#panel_02_photo").show();
// Hide an Element.
// (sym.$("name") resolves an Edge Animate element name to a DOM
// element that can be used with jQuery)
sym.$("#panel_01_photo").hide();
}
由于某种原因,它不起作用。感谢任何帮助的人。