Split Headlines on punctuation (code update)
I wanted to split the headlines on a few punctuation characters I use on my site for headers. To do that I updated the SPLIT HEADERS section of includes/get_javascript.php
Now the code will split around a hypen, vertical bar, colon, or else default back to spaces. I've included my initials in comments around my changes. I hope this helps others. PHP Code:
|
This worked perfectly. Thank you for sharing this.
|
It almost worked for me. I want ".org" to be the second color, but the period is still the first color. I imagine it won't take much to edit the code to do that, but I couldn't figure it out.
Another question. Why is this even done with Javascript at all; can't it just be done with CSS? Thanks for your help on this. |
An invisible split character would be nice. For example the Unicode Character Zero-width_non-joiner.
Here the code: Code:
$('" . $dual_title_colors . "').each( function() { Thanks |
To gain more control over the splitting it would be better to check for \u200C first and then for space:
Code:
$('" . $dual_title_colors . "').each( function() { |
Hi all,
is it possible that this doesn't work anymore in the newest Montezuma release? I had it working perfectly in the last release, but upgraded brainlessly without saving the old version. And the last backup I have is 3 days after the update. I copy/pasted troyp's complete function in ma .php file but still it doesn't work. Help please. |
The secret is: You have to save any Montezuma CSS once before it starts working again, I guess this is because of the virtual files structure of Montezuma.
|
All times are GMT -6. The time now is 07:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.