作者:mobiledu2502887333 | 来源:互联网 | 2022-12-04 12:54
1> Ankit Agarwa..:
该函数css()
期望函数参数以逗号分隔.您正在使用css('top': '60px')
,请注意:
哪里有错误.
$(document).ready(function() {
$('.rc-anchor-normal .rc-anchor-pt').css('position', 'absolute').css('top', '60px').css('right', '35px');
$('.rc-anchor-logo-img-portrait').css('position', 'absolute').css('right', '50px');
$('.rc-anchor-logo-text').css('position', 'absolute').css('right', '50px').css('top', '45px');
});
您还应该保持habbit F12
在chrome中查看浏览器控制台,以检查运行代码时出现的错误.
您还可以css()
使用对象表示将链接组合为单个链接:
$(document).ready(function() {
$('.rc-anchor-normal .rc-anchor-pt').css({
'position': 'absolute',
'top': '60px',
'right': '35px'
});
$('.rc-anchor-logo-img-portrait').css({
'position': 'absolute',
'right': '50px'
})
$('.rc-anchor-logo-text').css({
'position': 'absolute',
'right': '50px',
'top': '45px'
});
});