The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Adding a bit of colour
Zugfrig
post Dec 16 2013, 05:27 AM
Post #1


Novice
**

Group: Members
Posts: 24
Joined: 13-December 13
Member No.: 20,105



G'day I found a script online that I like and was wondering that when a user sorts the order they like if the is any way I could colour the first 18 choices in green no matter who they put in the first 18..

All others outside the first 18 would stay as default color.


Example is here http://tpctestsite.weebly.com/9000.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 16 2013, 06:11 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,819
Joined: 9-August 06
Member No.: 6



Probably. But it's jQuery which means it's hard to untangle for someone who isn't very much into jQuery and its ins and outs. Had it been "normal" JavaScript someone, maybe Christian, had probably been able to modify it for you.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 16 2013, 08:51 AM
Post #3


.
********

Group: WDG Moderators
Posts: 9,807
Joined: 10-August 06
Member No.: 7



Couldn't CSS selectors be used for that? E.g. the :first-child and its subsequent 17 siblings? Pandy knows this better than me. cool.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 16 2013, 10:30 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,819
Joined: 9-August 06
Member No.: 6



If you make the script add IDs with ascending values to the OPTIONs, I'll provide the CSS. biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 16 2013, 12:16 PM
Post #5


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



This will do the trick (only for browsers that support CSS3 selectors, http://caniuse.com/#search=nth-child ).
CODE
#sortableList li:nth-child(-n+18) {
    background-color: green;
    color: #fff;
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Zugfrig
post Dec 16 2013, 07:25 PM
Post #6


Novice
**

Group: Members
Posts: 24
Joined: 13-December 13
Member No.: 20,105



QUOTE(Frederiek @ Dec 17 2013, 04:16 AM) *

This will do the trick (only for browsers that support CSS3 selectors, http://caniuse.com/#search=nth-child ).
CODE
#sortableList li:nth-child(-n+18) {
    background-color: green;
    color: #fff;
}





this looks simple and promising...... ok now don't laugh but where exactly in the origianl script do i paste it? blush.gif blush.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Zugfrig
post Dec 16 2013, 09:24 PM
Post #7


Novice
**

Group: Members
Posts: 24
Joined: 13-December 13
Member No.: 20,105



Just an update, i posted your srcipt back to Jotform in hope of a wuick reply and they have replied as shown here http://www.jotform.com/answers/304806-orde...age=10732640770

can we get around them? or can we "recreate" it not in this iframe? or widget? form...... im lost blink.gif

This post has been edited by Zugfrig: Dec 16 2013, 09:27 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 17 2013, 01:08 AM
Post #8


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,819
Joined: 9-August 06
Member No.: 6



QUOTE(Zugfrig @ Dec 17 2013, 01:25 AM) *

this looks simple and promising...... ok now don't laugh but where exactly in the origianl script do i paste it? blush.gif blush.gif


Not in a script. In your style sheet. And it won't work in all browsers since it's CSS3.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Zugfrig
post Dec 17 2013, 01:53 AM
Post #9


Novice
**

Group: Members
Posts: 24
Joined: 13-December 13
Member No.: 20,105



QUOTE(pandy @ Dec 17 2013, 05:08 PM) *

QUOTE(Zugfrig @ Dec 17 2013, 01:25 AM) *

this looks simple and promising...... ok now don't laugh but where exactly in the origianl script do i paste it? blush.gif blush.gif


Not in a script. In your style sheet. And it won't work in all browsers since it's CSS3.


Hi, again I'll plead my ignorance and ask what my style sheet is...... I did however read Fredrick's link about css3 browsers and given there only 10 users I've confirmed with them what they are using and I'm happy with what browsers css3 covers...

Might be best to read my other post where I have explained myself better. http://forums.htmlhelp.com/index.php?showtopic=19318
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 17 2013, 08:48 AM
Post #10


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,819
Joined: 9-August 06
Member No.: 6



You use no less than 8 style sheets for the page if I counted right.

See http://htmlhelp.com/reference/css/ .

BTW some of them are in BODY. They should be in HEAD.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 17 2013, 08:57 AM
Post #11


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Agreed, it's a lot. And I wonder if all that is really needed.

In this case, my CSS snippet should be in the CSS file for the iframe page (orderPicker.css). But since that comes from another domain (like other CSS files), he has no access to it. And the snippet I posted, won't work when put outside the iframe page. I already tried. Besides, the discussion now continues at http://forums.htmlhelp.com/index.php?showtopic=19318 .
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th May 2025 - 03:58 PM