I have two type of different div : some are small and some are large.
I would like the small ones to have the same width than the large ones.
It seems I can't use $(this)
inside a .css
attribute.
You need to include jQuery instead of mootools.
And you need to define a callback function along with css()
This will probably look like this:
$('.small').css('width',function(){
return $(this).siblings('.large').css('width');
});
$('.small').each(function(){
$(this).css('width', $(this).siblings('.large').width());
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.