在jquery中了解偽元素的限制:訪問“ selector
嘗試修改“:”選擇器的CSS屬性時,您可能會遇到困難。 This is because pseudo-elements are not part of the DOM (Document Object Model) and are therefore inaccessible via direct JavaScript methods.
Solution: Introducing a Class with New ":after" PropertiesTo overcome this limitation, you can create a new CSS class that specifies the desired modifications to the ":after" selector.此類的特異性將比原始“:after”規則更高,允許其覆蓋默認設置。
例如:jquery: $('。pagemenu .Active')。 toggleclass('flose''');
通過將“更改”類添加到所需元素中,您有效地在“:”之後指定的“:”屬性。 css。注意:
很重要的是,請記住,在操縱“:”之後,“元素通常不可能直接使用,因此,有些技術可以允許您閱讀和覆蓋其屬性。有關這些方法的全面信息,請參閱外部資源。免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3