Giter Site home page Giter Site logo

Comments (8)

wimbarelds avatar wimbarelds commented on July 19, 2024

Try .rebuild()

from timecircles.

mgsmul avatar mgsmul commented on July 19, 2024

I meant rebuild() instead of reload()...late night. heh

It changes the text but it also removes the addListener created for the $span.text(minutes + ":" + seconds) change for the new timecircle built.

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

I'm currently on my phone, so I can't test anything or write much code, but in this case I would probably simply look up the container for the text and change it manually. Ill give you a more elaborate answer when I have a bit more time.

from timecircles.

mgsmul avatar mgsmul commented on July 19, 2024

Ah no worries. I can do that. Seriously awesome response time...actually unbelievable. Thanks!

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

A question... Are you using the latest version of TimeCircles? Because if you are, it should actually not remove the listeners.

from timecircles.

mgsmul avatar mgsmul commented on July 19, 2024

I was not - but updated and still had the same issue.

I was able to fix it by using the following: $('.textDiv_Seconds h4').html('New Title');

Thanks again!

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

Two things.

  1. Could you tell me where you have this deployed so I can try figure out why it's removing the listener?
  2. Though it doesn't really matter in this case, it's recommended to use .text() for setting actual text. The reason is that things like < and > end up as text instead of html. Like I said, doesn't matter in this case, but it's a good thing to get used to doing.

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

Actually on reflection I know why it doesn't work.

The listener is not removed. However, .rebuild() will remove all html and rebuild it. This means that whatever div or span you had a link to no longer exists. ie: $span no longer refers to any real html element inside TimeCircles.

Either way, next time I continue development I'll probably try to get it so that the texts can be changed without having to call rebuild. For now however, this seems resolved.

from timecircles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.