Comments (7)
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.
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.
The problem is solved. I declared button click event like this:
$(body).on('click', '#aaButton', function() {
myFunction();
}
from jbox.
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.
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.
Thanks you very much.
from jbox.
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)
- Tooltip - best way to grab element to use as content HOT 2
- Invalid z-index for tooltip attached to an element placed in jbox modal
- Add ability to set default z-index for all jBox instances
- Modal not opening first time click. HOT 7
- JQMIGRATE: jQuery.type is deprecated HOT 4
- How can use confirm box to submit the form? HOT 6
- Dynamic content causes height of modal to exceed window height with no scrolling HOT 4
- zindex auto with bootstrap modals HOT 1
- Example please HOT 2
- 为啥会隐藏已有的title标签 HOT 1
- Closing jBox from Content HOT 2
- svg as part of jBox content doesn't display properly, getting closeButton styling HOT 1
- jbox tooltip stay on screen after element destroyed HOT 1
- Close all tooltips when opening new HOT 2
- Attach JBox tooltip to disabled button HOT 2
- How to prevent jBox from closing? HOT 2
- Bootstrap Datatables Issue HOT 1
- closeButton: true does not produce a close Button
- Mouse plugin - prevents opening links on mobile devices
- add "center" as attribute positioning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbox.