Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #4261

Re: removing "stop" button (jquery and timer)

From justaguy <lichunshen84@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: removing "stop" button (jquery and timer)
Date 2011-07-17 20:45 -0700
Organization http://groups.google.com
Message-ID <27966898-bebf-4c8c-872e-3450c8a5e2f2@p29g2000pre.googlegroups.com> (permalink)
References <c189403d-74f2-4bf0-8cc9-b799e49e9846@y13g2000prb.googlegroups.com> <18a5aabc-a0ed-4098-bdba-2e45e3d89907@j14g2000prn.googlegroups.com>

Show all headers | View raw


On Jul 17, 10:44 pm, RobG <rg...@iinet.net.au> wrote:
> On Jul 18, 2:08 am, justaguy <do...@yahoo.com> wrote:
>
> > Hi,
>
> > I've inherited a piece of js code (two js files) that makes two HTML
> > elements as two slides with jquery (endless loop with a stopper).
>
> > I've decided to make it 2 loops only, easy, I set up a loop counter.
> > And now I'd like to remove the "stop" label/text once it finishes the
> > second/last loop, btw, this "stop" labele is automatically generated
> > with jquery (version 1.2.6), getting rusty with javascripting, don't
> > know how.
> > Here's the URL in question,http://www.knowledgenotebook.com/
>
> > Would appreciate your help.
>
> I guess you would add:
>
>   if (loopCnt < 3) {
>
>     // current stuff
>
>   } else {
>
>     // In jQuery
>     $('#slider-stopper').text('whatever');
>
>     // or in POJS
>     document.getElementById('slider-stopper').innerHTML = 'whatever';
>
>     // or just get rid of it
>     document.getElementById('slider-stopper').style.visibility =
> 'hidden';
>
>     // More robust
>     var el = document.getElementById('slider-stopper');
>     if (el && el.style) el.style.visibility = 'hidden';
>
>   }
>
> > P.S.
> > On a side note, I don't understand why we would need 100k js file
> > (jquery, not that I have something against it) for such a simple task
> > (replace an HTML element with a timer!)...
>
> Yes, hard to fathom. It seems to me that the two "slides" should be
> one above the other so if scripting is disabled or not available they
> are both visible. If scripting is available, then do the cross-fade
> thing. A simple function to do that is not many lines of code.
>
> But such effects are annoying if the user hasn't had time to read the
> slide before it fades, it would be better to make the page static. But
> advertising types like colour and movement, it attracts the eye and
> makes the site more dynamic. A better strategy is to make the dynamic
> stuff unimportant, so you have the effect without the potential loss
> of functionality.
>
> --
> Rob

Rob, you're a genius, thank you.  I searched for key word, "stop" in
both scripts before to no avail... definitely your sight is superior
among others...
today with "slider-stopper", spot on, I saw the "stop" link...
At such low cost, I definitely go for the robust solution, it works
perfectly with FF 3.6, IE9 and Chrome12 and Safari 5 (all on win7).

I'm totally with you about the over-riding importance of
functionality, however, too bad it seems that most college students
these days associate this type of fluffy coolness with underlying
technology and their perception of value...

On the technical side, I also attempted to make the height of the
second slide shorter but without success, currently they both are
inside the "slider" container.

Thanks again.

Don

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

removing "stop" button (jquery and timer) justaguy <donli@yahoo.com> - 2011-07-17 09:08 -0700
  Re: removing "stop" button (jquery and timer) RobG <rgqld@iinet.net.au> - 2011-07-17 19:44 -0700
    Re: removing "stop" button (jquery and timer) justaguy <lichunshen84@gmail.com> - 2011-07-17 20:45 -0700

csiph-web