gpt4 book ai didi

javascript - 如何在 JavaScript 设置代码中添加 CSS 类?

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

我需要 JavaScript 帮助。

我有这个 slider 脚本:

stepcarousel.setup({
galleryid: 'mygallery', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'panel', //class of panel DIVs each holding content
autostep: {
enable:true,
moveby:1,
pause:3000
},
panelbehavior: {
speed:500,
wraparound:false,
wrapbehavior:'slide',
persist:true
},
defaultbuttons: {
enable: true,
moveby: 1,
leftnav: ['arl.png', -5, 80],
rightnav: ['arr.png', -20, 80]
},
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: ['inline'] //content setting ['inline'] or ['ajax', 'path_to_external_file']
})

我实际上想要 defaultbuttons 有一个类(例如 class="defaultbuttons" ) 因为我无法访问 HTML,因为脚本正在“回显”它,我猜是在加载时......我明白了:

<img src="arl.png" 
title="Back 1 panels"
style="z-index: 50;
position: absolute;
left: 3px;
top: 88px;
cursor: pointer;
opacity: 1;"
>

我想添加一个简单的类来做进一步的造型。非常感谢您的帮助;)

最佳答案

我明白了。我应该深入研究 js..我可以找到这个

<img src="'+config.defaultbuttons.leftnav[0]+'">

那么,问题解决了!谢谢大家的提示和帮助;)

关于javascript - 如何在 JavaScript 设置代码中添加 CSS 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27019062/

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