I try to change float attribute of menu item by css. I want when body tag has rtl class , float of menu items set with right I wrote this jquery for do this but must done this change before load page .At the result I want do this work with css .
if ($('body').hasClass("rtl")) { $('#cssmenu > ul > li').attr('float','right');}
Now How to convert this jquery code to css?
You can use
body.rtl #cssmenu > ul > li {
float: right;
}
The JS code in question has many errors. Here's one if still interested to use JS.
$('body.rtl #cssmenu > ul > li').css('float', 'right');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With