Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: [DHTML] Rainbow link on mouseOver

  1. #11
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you fix the error on line 23:

    Code:
    2e, delay:50, property:backgroundColor",
    by getting rid of that extra comma, now you really have something! Just as a note, I didn't really inspect the code enough to see why that is an error, but it is something like the fact that one should never have a comma after the last property in an object, and almost always never, item in an array. FF (Konq perhaps as well, I have no idea), by the way forgives this, others do not.

    Hey DD, how about upgrading the one in the library with (once fixed) Twey's?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Whoops! It seems Konq does forgive the extra comma. I'd thought it wouldn't since Safari apparently doesn't. Oh well, fixed anyway. Opera is the only browser I know for sure doesn't tolerate extra commas in objects, but I hear Safari and IE don't either.
    Just as a note, I didn't really inspect the code enough to see why that is an error, but it is something like the fact that one should never have a comma after the last property in an object, and almost always never, item in an array.
    Only the former. Extra commas in arrays have a special meaning: the omitted values are undefined (e.g. [1, 2, , 4] is equivalent to [1, 2, undefined, 4]). As such, the trailing comma in an array is, whilst completely useless (unspecified elements are undefined anyway), perfectly valid.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    More 'problems' - Because the classes are being rewritten to suit your nomenclature without preserving the class name for styling purposes, the classes cannot be styled in a stylesheet, that could probably be easily changed by introducing a space after the actual class name and before all that other stuff you are appending to it, with appropriate adjustments to the processing code, if needed.

    What's puzzling me is that if I change the page's background color, the bluish bg one seems to stop working. I made up a primary bg one, and that seemed unaffected.

    Now about extra commas in arrays, yes its just undefined, but for all practical purposes, depending upon the rest of the code, that should never be done, as it makes the length property grow by one, often causing scripts to break. You are correct though, in and of itself, it doesn't make the parser barf in the same way that just reading an object with an extra comma does.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #14
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    More 'problems' - Because the classes are being rewritten to suit your nomenclature without preserving the class name for styling purposes, the classes cannot be styled in a stylesheet, that could probably be easily changed by introducing a space after the actual class name and before all that other stuff you are appending to it, with appropriate adjustments to the processing code, if needed.
    Whoops -- I did fix this earlier but it seems to have made its way back in. Mistaken undo, perhaps.
    What's puzzling me is that if I change the page's background color, the bluish bg one seems to stop working. I made up a primary bg one, and that seemed unaffected.
    I think it's just hard to see. The effect is very faint, because blue contrasts with black quite a bit so it's not necessary to make it very heavy. Make it a little lighter:
    Code:
    'bluish-bg' : "property:backgroundColor, #000, #001, #002, #003, #004, #005, #006, #007, #008, #009, #00a, #009, #008, #007, #006, #005, #004, #003, #002, #001",
    Now about extra commas in arrays, yes its just undefined, but for all practical purposes, depending upon the rest of the code, that should never be done, as it makes the length property grow by one, often causing scripts to break.
    It doesn't (at least in SpiderMonkey and KJS):
    Code:
    js> [1, 2, 3, 4, 5].length
    5
    js> [1, 2, 3, 4, 5, ].length
    5
    although explicitly specifying undefined does:
    Code:
    js> [1, 2, 3, 4, 5, undefined].length
    6
    As do extra commas:
    Code:
    js> [1, 2, 3, 4, 5, , ].length
    6
    Last edited by Twey; 11-24-2007 at 07:21 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #15
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <script type="text/javascript">
    var t=[1,2,3];
    var tc=[1,2,3,];
    alert (t.length+' '+tc.length);
    </script>
    Gotta love IE:

    3 4
    Opera, FF, and Safari (win) all say 3 3.

    I'm now not getting the bluish or ghostly bg changes at all, even with the default page. I think you misunderstood me, the bluish one was working with the default page, last time - only stopped working when I changed the page's bg color. Both times I took off my glasses and put my face right up to the screen, nothing.

    Funning thing is, FF's DOM inspector shows the values changing. Now, suddenly, I'm just not sure - why not make the bg ones contrast enough for about anyone to be able to tell?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #16
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    why not make the bg ones contrast enough for about anyone to be able to tell?
    Because it doesn't look nearly as cool and the ones I have contrast nicely enough with the black Nevertheless, I've added some Very Definitely Blue/Green Background links.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #17
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    Because it doesn't look nearly as cool and the ones I have contrast nicely enough with the black Nevertheless, I've added some Very Definitely Blue/Green Background links.
    I thought it might be something like that however, on a laptop, the are way too cool (read absolute zero - dead). A middle ground would be good, I do see the high contrast ones as a bit much.

    Also, there is a delay property, but it seems to be between cycles, smoothness depends upon the number of changes, perhaps a speed property could be added.
    Last edited by jscheuer1; 11-24-2007 at 08:58 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #18
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, the demo page isn't of great importance. I'm sure if DD decides to feature it, he'll edit it anyway (aren't the DD demo pages white?).
    Also, there is a delay property, but it seems to be between cycles, smoothness depends upon the number of changes, perhaps a speed property could be added.
    I'm not sure I understand you. Speed would just be another way of calculating the delay, unless you're talking about fading one colour to another programmatically? I was thinking of doing that, but the syntax would become much more complex.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #19
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You understand, I'm thinking of either generating intermediate stages or slowing the changes between the existing stages depending upon how many there are.

    I think if this could all be worked out, DD might want it. His initial comment in this thread seemed to indicate that he wasn't interested in a rainbow clone though. So, if you get this thing whipped into a shape that you'd like to submit it as, I think a new thread and a title like:

    Pulsing Links

    would be in order.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •