Forum closed. New forum available at http://community.wymeditor.org/

CSS expressions

Support forum for WYMeditor.

CSS expressions

Postby dacha on Thu Jul 19, 2007 1:29 am

I have question about defineing the expression that decides wheter style should be applied or not. If I use expression
Code: Select all
p[@class!="red"]

it will match paragraph with 'red' class only
Code: Select all
<p class="red">text</p>

but will not match paragraph with more then one class
Code: Select all
<p class="red right">text</p>

Is there a way to said ''NOT IN CLASS LIST' or 'NOT SUBSTRING' instead of 'NOT EQUAL' (!=), or some other solution?

Thank you
dacha
 
Posts: 7
Joined: Wed Jul 18, 2007 1:35 am

Postby jfh on Thu Jul 19, 2007 7:15 am

Perhaps this could help:
http://docs.jquery.com/DOM/Traversing/S ... _different

If you don't find the required selector, you can create one yourself by extending jQuery.expr[':']
Please see http://www.mail-archive.com/discuss@jqu ... 15863.html and http://www.malsup.com/jquery/expr/ for more information.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby dacha on Thu Jul 19, 2007 9:58 am

I did read JQurey Selectors page before I post my question, but I didn't fint solution. It is strange that selector '!=' is not documented anywhere. Also, selector
Code: Select all
E[@foo*=bar] an E element whose "foo" attribute value contains the substring "bar"

don't work with WYMEditor for me (if I use it, class don't work at all).

At a first look, I think those links about extending will help me to solve this.

Thank you
dacha
 
Posts: 7
Joined: Wed Jul 18, 2007 1:35 am

Postby dacha on Thu Jul 19, 2007 12:11 pm

I made syntax error with selector '*=', it actually works. With this selector working, solution for what I want is
Code: Select all
p:not([@class*="red"])

It's simple :-)
dacha
 
Posts: 7
Joined: Wed Jul 18, 2007 1:35 am

Postby jfh on Fri Jul 20, 2007 9:12 pm

Cool, thanks for the tip.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest