开发者

In GWT how to know all the styles applied to a given element (by id or class name)

开发者 https://www.devze.com 2023-01-06 06:03 出处:网络
I have the following problem : in my GWT project there is a \"main\" css file for the application, inline css in the DOM that come from the application computation and a css file that is bundled in an

I have the following problem : in my GWT project there is a "main" css file for the application, inline css in the DOM that come from the application computation and a css file that is bundled in an archive uploaded to the application and dynamically loaded.

Now I need for an Element to find which CSS rules are applied, coming from either of the three sources. As I understand, GWT's getStyle() function only returns informations that are in the DOM.

What's the simplest way to achieve this ?

Edit : If possible, I search for a client-side solution (in java or javascript) rat开发者_如何学编程her than a server-side one.


Found a solution to my problem (in fact two but I'm going for the first) :

  1. Using jQuery's css() that does what I wanted
  2. A pure javascript solution in this SO question

I now just have to write a JNSI wrapper for the jQuery function...

Edit : Found a third solution which correspond exactly to what I want : GQuery which is a port of jQuery to GWT and contains (according to the main page) 98% of jQuery's core functionalities.

0

精彩评论

暂无评论...
验证码 换一张
取 消