News for hackers. Stuff that matters.
Re:-= sequoia capital =- by icey on Wednesday August 19, 2009 @02:13PM (#773331)
Needs more blink.
Re:-= sequoia capital =- by tlrobinson on Wednesday August 19, 2009 @06:42PM (#773975)
Apparently the BLINK tag doesn't actually work in some modern browsers, so I had to reimplement it in JavaScript. If you'd like to use it on your own site, here's the code:

    var blinkOn = 1;
    window.setInterval(function() {
        var blinks = document.getElementsByTagName("blink");
        for (var i = 0; i < blinks.length; i++)
            blinks[i].style.visibility = blinkOn ? "visible" : "hidden";
        blinkOn ^= 1;
    }, 500);
Re:-= sequoia capital =- by ars on Wednesday August 19, 2009 @07:39PM (#774085)
Just a small note - you should not explicitly set the visibility to "visible", set it to the empty string "" instead. This way you don't overwrite the default property if it was something else.

And you can skip the blinkOn variable by:

  blinks[i].style.visibility = blinks[i].style.visibility == "" ? "hidden" : "";
Re:-= sequoia capital =- by invisible on Wednesday August 19, 2009 @09:12PM (#774206)
That's actually way slower because you're doing a comparison within an iteration. That's putting an if statement inside a loop while the result is the same for every iteration.
Re:-= sequoia capital =- by ars on Wednesday August 19, 2009 @09:35PM (#774236)
Computers are not that slow these days :)

It reduces complexity and a global, which is far more important.

And that blink loop is probably not that big - just how many blink tags do you have?

I don't use it for blink loops anyway, I use it for toggle on/off, where keeping state for each element individually is pretty important.

Re:-= sequoia capital =- by invisible on Thursday August 20, 2009 @01:10PM (#775495)
You're accessing the DOM every iteration, so I'd bet that it does matter somewhat if blink is used a lot.

You can avoid polluting by make it an actual function and then setting the function.blinkOn instead.

You're right: individually swapping them this works better, but the intent is to have them all off or all on.

  (function() {
    var blinkIterator = function() {
        var blinks = document.getElementsByTagName("blink"),
         onOff = blinkIterator.blinkOn ? "" : "hidden";
        for (var i = 0, l = blinks.length; i < l;)
            blinks[i++].style.visibility = onOff;
        blinkIterator.blinkOn ^= 1;
    };
    blinkIterator.blinkOn = 1;
    window.setInterval(blinkIterator, 750);
  })();
Re:-= sequoia capital =- by catch23 on Thursday August 20, 2009 @12:37AM (#774441)
You don't need all that complexity. just use CSS:

text-decoration: blink

Works in FF 3.5

Re:-= sequoia capital =- by tlrobinson on Thursday August 20, 2009 @01:05AM (#774476)
Well, no. Browsers that don't support "blink" tags also don't support "text-decoration: blink".

I'd hardly call it complex either.

Re:-= sequoia capital =- by icey on Wednesday August 19, 2009 @07:10PM (#774045)
Well played, sir.
Re:-= sequoia capital =- by jonursenbach on Wednesday August 19, 2009 @02:58PM (#773468)
And copy/pasted DHTML snowflake effects.
Re:-= sequoia capital =- by nopassrecover on Thursday August 20, 2009 @01:07AM (#774477)
Re:-= sequoia capital =- by zaidf on Wednesday August 19, 2009 @08:48PM (#774184)
Where the marquee at??