Giter Site home page Giter Site logo

Comments (7)

nhaemu avatar nhaemu commented on May 18, 2024

i want to use jbox notice as incoming message which showing data and two buttons. I insert string of element in content. but when i click button it does not work.

from jbox.

StephanWagner avatar StephanWagner commented on May 18, 2024

Sorry for answering so late! If you are still having that problem, could you provide some code, so I can have a look at what you are trying to do.

from jbox.

nhaemu avatar nhaemu commented on May 18, 2024

The problem is solved. I declared button click event like this:
$(body).on('click', '#aaButton', function() {
myFunction();
}

from jbox.

StephanWagner avatar StephanWagner commented on May 18, 2024

Ok, its not the nicest solution, but if it works for you, all right.
If you still want me to have a look at it, post some code how you open the notice, I might have a more solid solution.

from jbox.

StephanWagner avatar StephanWagner commented on May 18, 2024

Ah, OK, I see what you'd like to do.

Firstly, I think you would be better off creating this with a jBox 'Modal' as jBox Notices normally are only useful to show a notice and then disappear. Let me know if you like a jBox Modal Example that has the same functionality as your example, I'd be more than happy to create one.

Meanwhile, your code does work, but I have a few improvements if you like:
$('body') - clicks should generally be avoided, read Section Event performancy here: http://api.jquery.com/on/
I would just add an onclick event to the button.

Also, Notices close themselves when you click on the notice itself (anywhere). So I would add the option closeOnClick: false. And then I would store the notice reference in an object so you can close it manually.

See this fiddle here, thats how I would do it with type Notice: http://jsfiddle.net/StephanWagner/gybpytr4/

But as I said above, you could achieve the same behavior with type Modal.

from jbox.

nhaemu avatar nhaemu commented on May 18, 2024

Thanks you very much.

from jbox.

StephanWagner avatar StephanWagner commented on May 18, 2024

That must be an error on your side then. When you define the function in global scope, the onclick="" of the button will find it.

Alternatively you could also just add the doCheck function when jBox has been created:
http://jsfiddle.net/StephanWagner/gybpytr4/2/

from jbox.

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.