Something like the below?

(function($) {
                  $.fn.JSClock = function() {
                          setInterval(function() {
                               // code to get and write time here
                          }, 1000);
                   }

})(jQuery);

$(document).ready(function() {
        $('#clock').JSClock();

On Apr 22, 2:13 pm, kiusau <kiu...@mac.com> wrote:
> On Apr 22, 4:50 pm, Joseph Le Brech <jlebr...@hotmail.com> wrote:
>
> > cant you change your anonymous function for a seperate named function that 
> > takes in the html element name funcclock(elem, interval).
>
> > the fn command can run it once funcclock($(this));
>
> > the function can then rerun itself with setTimeout("funcname", interval);
>
> If I have understood your suggestion properly, you want me to imbed
> the html element to which the clock display is assigned inside the
> function that creates the clock.  As my idea is to build a jQuery
> method that I can assign to any HTML element, your suggestion appears
> counterproductive.  Or, have I misunderstood?
>
> Roddy

Reply via email to