- Posts: 39
COMMUNITY FORUM
K2 Item Title Spaces
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
11 years 8 months ago #116145
by andrea
K2 Item Title Spaces was created by andrea
hi guys, i try to make a different color the first word of the itemTitle (item.php) with this jquery code:
Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116146
by Kannan Naidu Venugopal
K2 Rocks \m/
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
You can try this code here, see if it helps - blog.codez.in/jquery-css-styling-first-word-of-a-text-differently/jquery/2010/08/23
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116147
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
i've tryed too this solution but always the same problem with space :\
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116148
by Kannan Naidu Venugopal
K2 Rocks \m/
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
is there any css value that is messing the spacing ? like word-spacing or letter-spacing. Can share the link to your site ?
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116149
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
i have in local, i put the code html and css
HTML becomes:
HTML becomes:
Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116150
by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
You mentioned that you want to change the first word to a different color, but this code sets the background and font color of the entire h2.
Why are you using <strong></strong> ?
You should be using something like <span></span> for the js
Your html output should be
Why are you using <strong></strong> ?
You should be using something like <span></span> for the js
Your html output should be
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116151
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
I've used <strong> for test.
The problem there isn't strong, span or other, the problem is the k2 make a space and the js code don't work and the output is:
The problem there isn't strong, span or other, the problem is the k2 make a space and the js code don't work and the output is:
Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116152
by Kannan Naidu Venugopal
K2 Rocks \m/
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
Have you tried by just using <h2> only or try <h2 class="mytitle"> ?
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116153
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116154
by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
Here's what i did, and it worked like a charm :)
My JS
My JS
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116155
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116156
by Kannan Naidu Venugopal
K2 Rocks \m/
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116157
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
look skype
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116158
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
The script don't work only in the K2 Item title:
Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116159
by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
Try changing the existing code to just this, remove the rest
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116160
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
i've tryed.. the problem is the php variable:
Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago #116161
by Kannan Naidu Venugopal
K2 Rocks \m/
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
It's not the variable, you're trying to achieve this at category item listings ? I tried the same and it didn't work because of the link tag, but if you try this on item page, it works as there is no link to it.
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- andrea
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 8 months ago #116162
by andrea
Replied by andrea on topic Re: K2 Item Title Spaces
I'm trying in item page.. (item.php).. and still not work.. :(
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 8 months ago - 11 years 8 months ago #116163
by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: K2 Item Title Spaces
This is what i have in item.php file and it works..
K2 Rocks \m/
Please Log in or Create an account to join the conversation.